r87140 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87139‎ | r87140 | r87141 >
Date:21:59, 29 April 2011
Author:bawolff
Status:ok
Tags:
Comment:
Set it's s-maxage to 1800 (half hour) per comments on the bug report.

Was originally going to directly output the header in order to also set
max-age, but the rss class seems to already do the caching header so use
wgOut's method.
Modified paths:
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php (modified) (history)
  • /trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php
@@ -43,7 +43,8 @@
4444 * main()
4545 **/
4646 public function execute( $par ) {
47 - global $wgContLang, $wgSitename, $wgFeedClasses, $wgLanguageCode, $wgMemc;
 47+ global $wgContLang, $wgSitename, $wgFeedClasses,
 48+ $wgLanguageCode, $wgMemc, $wgOut, $wgGNSMsmaxage;
4849
4950 list( $params, $categories, $notCategories ) = $this->getParams();
5051
@@ -71,6 +72,8 @@
7273 return;
7374 }
7475
 76+ $wgOut->setSquidMaxage( $wgGNSMsmaxage );
 77+
7578 $cacheInvalidationInfo = $this->getCacheInvalidationInfo( $params,
7679 $categories, $notCategories );
7780
Index: trunk/extensions/GoogleNewsSitemap/GoogleNewsSitemap.php
@@ -73,8 +73,15 @@
7474 // Configuration options:
7575 $wgGNSMmaxCategories = 6; // Maximum number of categories to look for
7676 $wgGNSMmaxResultCount = 50; // Maximum number of results to allow
77 -$wgGNSMfallbackCategory = 'Published'; // Fallback category if no categories are specified.
7877
 78+// Fallback category if no categories are specified.
 79+$wgGNSMfallbackCategory = 'Published';
 80+
 81+// How long to put in squid cache. Note also cached using wgMemc (for 12 hours),
 82+// but the wgMemc entries are checked to see if they are still relevant, where
 83+// the squid cache is not checked. So this should be a small number.
 84+$wgGNSMsmaxage = 1800; // = 30 minutes
 85+
7986 // $wgGNSMcommentNamespace can be false to mean do not include a <comments> element in the feeds,
8087 // or it can be true, to mean use the talk page of the relevent page as the comments page
8188 // or it can be a specific namespace number ( or NS_BLAH constant) to denote a specific namespace.

Status & tagging log