From cd6707ca186d480544cbd0473019cb358e83b3bd Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 8 Sep 2019 05:11:22 +0100 Subject: [PATCH] Remove support for wgUseESI Experimental feature deprecated since 1.33 (d63684a064b09). Change-Id: I9bab4ad1cd1f2c80a3dfcccdf99ed011c9c8a440 --- RELEASE-NOTES-1.34 | 1 + includes/AjaxResponse.php | 11 +---------- includes/DefaultSettings.php | 6 ------ includes/OutputPage.php | 36 ++++++++++-------------------------- 4 files changed, 12 insertions(+), 42 deletions(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index aaf4d78fea..d764b4811c 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -80,6 +80,7 @@ $wgPasswordPolicy['policies']['default']['PasswordNotInLargeBlacklist'] = false; * $wgWikiDiff2MovedParagraphDetectionCutoff — If you still want a custom change size threshold, please specify in php.ini, using the configuration variable wikidiff2.moved_paragraph_detection_cutoff. +* $wgUseESI - This experimental setting, deprecated in 1.33, is now removed. * $wgDebugPrintHttpHeaders - The default of including HTTP headers in the debug log channel is no longer configurable. The debug log itself remains configurable via $wgDebugLogFile. diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index 323c5d30ac..0664652a7e 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -182,16 +182,7 @@ class AjaxResponse { if ( $this->mConfig->get( 'UseCdn' ) ) { # Expect explicit purge of the proxy cache, but require end user agents # to revalidate against the proxy on each visit. - # Surrogate-Control controls our CDN, Cache-Control downstream caches - - if ( $this->mConfig->get( 'UseESI' ) ) { - wfDeprecated( '$wgUseESI = true', '1.33' ); - header( 'Surrogate-Control: max-age=' . $this->mCacheDuration . ', content="ESI/1.0"' ); - header( 'Cache-Control: s-maxage=0, must-revalidate, max-age=0' ); - } else { - header( 'Cache-Control: s-maxage=' . $this->mCacheDuration . ', must-revalidate, max-age=0' ); - } - + header( 'Cache-Control: s-maxage=' . $this->mCacheDuration . ', must-revalidate, max-age=0' ); } else { # Let the client do the caching. Cache is not purged. header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->mCacheDuration ) . " GMT" ); diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5d3fba740f..00708f459c 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2748,12 +2748,6 @@ $wgExtensionInfoMTime = false; */ $wgUseCdn = false; -/** - * If you run Squid3 with ESI support, enable this (default:false): - * @deprecated in 1.33. This was a now-defunct experimental feature. - */ -$wgUseESI = false; - /** * Add X-Forwarded-Proto to the Vary and Key headers for API requests and * RSS/Atom feeds. Use this if you have an SSL termination setup diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 15a759b119..7f005fb7cd 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2414,32 +2414,16 @@ class OutputPage extends ContextSource { $this->mCdnMaxage != 0 && !$this->haveCacheVaryCookies() ) { - if ( $config->get( 'UseESI' ) ) { - wfDeprecated( '$wgUseESI = true', '1.33' ); - # We'll purge the proxy cache explicitly, but require end user agents - # to revalidate against the proxy on each visit. - # Surrogate-Control controls our CDN, Cache-Control downstream caches - wfDebug( __METHOD__ . - ": proxy caching with ESI; {$this->mLastModified} **", 'private' ); - # start with a shorter timeout for initial testing - # header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"'); - $response->header( - "Surrogate-Control: max-age={$config->get( 'CdnMaxAge' )}" . - "+{$this->mCdnMaxage}, content=\"ESI/1.0\"" - ); - $response->header( 'Cache-Control: s-maxage=0, must-revalidate, max-age=0' ); - } else { - # We'll purge the proxy cache for anons explicitly, but require end user agents - # to revalidate against the proxy on each visit. - # IMPORTANT! The CDN needs to replace the Cache-Control header with - # Cache-Control: s-maxage=0, must-revalidate, max-age=0 - wfDebug( __METHOD__ . - ": local proxy caching; {$this->mLastModified} **", 'private' ); - # start with a shorter timeout for initial testing - # header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" ); - $response->header( "Cache-Control: " . - "s-maxage={$this->mCdnMaxage}, must-revalidate, max-age=0" ); - } + # We'll purge the proxy cache for anons explicitly, but require end user agents + # to revalidate against the proxy on each visit. + # IMPORTANT! The CDN needs to replace the Cache-Control header with + # Cache-Control: s-maxage=0, must-revalidate, max-age=0 + wfDebug( __METHOD__ . + ": local proxy caching; {$this->mLastModified} **", 'private' ); + # start with a shorter timeout for initial testing + # header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" ); + $response->header( "Cache-Control: " . + "s-maxage={$this->mCdnMaxage}, must-revalidate, max-age=0" ); } else { # We do want clients to cache if they can, but they *must* check for updates # on revisiting the page. -- 2.20.1