jenkins-bot has submitted this change and it was merged.
Change subject: Cache Hide Requests
......................................................................
Cache Hide Requests
Change-Id: If6279142ad768959e1d05f4c67941a6f148d68ec
(cherry picked from commit 6cea54b182d53459988dd8ed2bb57bd40401bc73)
---
M special/SpecialHideBanners.php
1 file changed, 7 insertions(+), 1 deletion(-)
Approvals:
Mwalker: Looks good to me, approved
jenkins-bot: Verified
diff --git a/special/SpecialHideBanners.php b/special/SpecialHideBanners.php
index f947876..18e983e 100644
--- a/special/SpecialHideBanners.php
+++ b/special/SpecialHideBanners.php
@@ -6,6 +6,9 @@
* see fundrasing banners.
*/
class SpecialHideBanners extends UnlistedSpecialPage {
+ // Cache this blank response for a day or so (60 * 60 * 24 s.)
+ const CACHE_EXPIRY = 86400;
+
function __construct() {
parent::__construct( 'HideBanners' );
}
@@ -22,7 +25,10 @@
wfResetOutputBuffers();
header( 'Content-Type: image/png' );
- header( 'Cache-Control: no-cache' );
+ if ( !$this->getUser()->isLoggedIn() ) {
+ $expiry = SpecialHideBanners::CACHE_EXPIRY;
+ header( "Cache-Control: public, s-maxage={$expiry},
max-age=0" );
+ }
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/97150
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If6279142ad768959e1d05f4c67941a6f148d68ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Mwalker <[email protected]>
Gerrit-Reviewer: Mwalker <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits