summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/DefaultSettings.php2
-rw-r--r--includes/OutputPage.php14
2 files changed, 14 insertions, 2 deletions
diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 919d05b8..61fec6e1 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -75,7 +75,7 @@ $wgConfigRegistry = array(
* MediaWiki version number
* @since 1.2
*/
-$wgVersion = '1.26.1';
+$wgVersion = '1.26.2';
/**
* Name of the site. It must be changed in LocalSettings.php
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 );
}
/**