jenkins-bot has submitted this change and it was merged.

Change subject: Cache RecentChanges Atom feed in varnish for 15 seconds
......................................................................


Cache RecentChanges Atom feed in varnish for 15 seconds

Prior to fc20c30d209, the feed was cached for 10 seconds. That
change accidentally removed varnish caching. Re-add the caching,
and upping to 15 seconds for good measure (15 second delay on the RSS
feed shouldn't matter, people generally read those asynchronously
anyhow. I was thinking of maybe even uping to 30 seconds). Users
can still manually set an smaxage parameter via the url if they
don't like the default cache time.

This assumes nothing private (e.g. per user) is ever on the RSS
feed. Reading through the ChangesList code this appears to be
the case, as everyone is getting the feed from a shared
memcache entry.

Bug: 63249
Change-Id: I268d0a53067738ba96bee74c593358b0b28cc083
---
M RELEASE-NOTES-1.23
M includes/api/ApiFeedRecentChanges.php
2 files changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index ce3168e..754c177 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -249,6 +249,7 @@
 * Added list=prefixsearch that works like action=opensearch but can be used as
   a generator.
 * (bug 24782) Various modules will now use unique continuation parameters.
+* (bug 63249) Cache RecentChanges Atom feed in varnish for 15 seconds.
 
 === Languages updated in 1.23 ===
 
diff --git a/includes/api/ApiFeedRecentChanges.php 
b/includes/api/ApiFeedRecentChanges.php
index 9062ad9..a2641ee 100644
--- a/includes/api/ApiFeedRecentChanges.php
+++ b/includes/api/ApiFeedRecentChanges.php
@@ -52,6 +52,12 @@
                        $this->dieUsage( 'Invalid subscription feed type', 
'feed-invalid' );
                }
 
+               $this->getMain()->setCacheMode( 'public' );
+               if ( !$this->getMain()->getParameter( 'smaxage' ) ) {
+                       // bug 63249: This page gets hit a lot, cache at least 
15 seconds.
+                       $this->getMain()->setCacheMaxAge( 15 );
+               }
+
                $feedFormat = $this->params['feedformat'];
                $specialClass = $this->params['target'] !== null
                        ? 'SpecialRecentchangeslinked'

-- 
To view, visit https://gerrit.wikimedia.org/r/121912
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I268d0a53067738ba96bee74c593358b0b28cc083
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <bawolff...@gmail.com>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to