summaryrefslogtreecommitdiff
path: root/includes/OutputPage.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-21 06:22:43 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-21 06:22:43 +0100
commitfa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (patch)
tree9f88233923b8078787cd8b85b5d9ca18cf3245dd /includes/OutputPage.php
parent6d50fa2c1033bdb23fa4490b59c5648e78427157 (diff)
Update to MediaWiki 1.26.2
Diffstat (limited to 'includes/OutputPage.php')
-rw-r--r--includes/OutputPage.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 552e1815..69ed8def 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -236,6 +236,8 @@ class OutputPage extends ContextSource {
/** @var int Cache stuff. Looks like mEnableClientCache */
protected $mSquidMaxage = 0;
+ /** @var int Upper limit on mCdnMaxage */
+ protected $mCdnMaxageLimit = INF;
/**
* @var bool Controls if anti-clickjacking / frame-breaking headers will
@@ -1945,7 +1947,17 @@ class OutputPage extends ContextSource {
* @param int $maxage Maximum cache time on the Squid, in seconds.
*/
public function setSquidMaxage( $maxage ) {
- $this->mSquidMaxage = $maxage;
+ $this->mSquidMaxage = min( $maxage, $this->mCdnMaxageLimit );
+ }
+
+ /**
+ * Lower the value of the "s-maxage" part of the "Cache-control" HTTP header
+ *
+ * @param int $maxage Maximum cache time on the CDN, in seconds
+ */
+ public function lowerCdnMaxage( $maxage ) {
+ $this->mCdnMaxageLimit = min( $maxage, $this->mCdnMaxageLimit );
+ $this->setSquidMaxage( $this->mSquidMaxage );
}
/**