Mwalker has uploaded a new change for review.
https://gerrit.wikimedia.org/r/96643
Change subject: Cache Hide Requests
......................................................................
Cache Hide Requests
Change-Id: If6279142ad768959e1d05f4c67941a6f148d68ec
---
M special/SpecialHideBanners.php
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice
refs/changes/43/96643/1
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/96643
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If6279142ad768959e1d05f4c67941a6f148d68ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: wmf_deploy
Gerrit-Owner: Mwalker <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits