OutputPage: Remove $wgLoggedOutMaxAge experiment and related tests

Bug: T293848
Change-Id: I5e5e52fac7fe389b36715dae11cc30cdb2b9136a
This commit is contained in:
Tks4Fish 2021-10-20 13:16:03 -03:00 committed by Krinkle
parent 98fbea6293
commit 76e3701d6a
4 changed files with 5 additions and 32 deletions

View file

@ -40,6 +40,7 @@ For notes on 1.36.x and older releases, see HISTORY.
of C.UTF-8 or C and works around the remaining problems of the C locale by of C.UTF-8 or C and works around the remaining problems of the C locale by
not using escapeshellarg. This follows the direction of PHP 8.0, which sets not using escapeshellarg. This follows the direction of PHP 8.0, which sets
a locale of C by default instead of respecting LC_CTYPE. a locale of C by default instead of respecting LC_CTYPE.
* $wgLoggedOutMaxAge - Experiment removed, originally added in 1.35. (T293848)
* $wgIncludejQueryMigrate - Deprecated in 1.36. We only support jQuery v3. * $wgIncludejQueryMigrate - Deprecated in 1.36. We only support jQuery v3.
* … * …

View file

@ -3276,15 +3276,6 @@ $wgCdnMaxageLagged = 30;
*/ */
$wgCdnMaxageStale = 10; $wgCdnMaxageStale = 10;
/**
* Cache TTL for the user agent sent as max-age, for logged out users.
* Only applies if $wgUseCdn is false.
* @see $wgUseCdn
*
* @since 1.35
*/
$wgLoggedOutMaxAge = 0;
/** /**
* If set, any SquidPurge call on a URL or URLs will send a second purge no less than * If set, any SquidPurge call on a URL or URLs will send a second purge no less than
* this many seconds later via the job queue. This requires delayed job support. * this many seconds later via the job queue. This requires delayed job support.

View file

@ -2506,20 +2506,11 @@ class OutputPage extends ContextSource {
"s-maxage={$this->mCdnMaxage}, must-revalidate, max-age=0" ); "s-maxage={$this->mCdnMaxage}, must-revalidate, max-age=0" );
} else { } else {
# We do want clients to cache if they can, but they *must* check for updates # We do want clients to cache if they can, but they *must* check for updates
# on revisiting the page, after the max-age period. # on revisiting the page.
wfDebug( __METHOD__ . ": private caching ($privateReason); {$this->mLastModified} **", 'private' ); wfDebug( __METHOD__ . ": private caching ($privateReason); {$this->mLastModified} **", 'private' );
if ( $response->hasCookies() || SessionManager::getGlobalSession()->isPersistent() ) { $response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
$response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' ); $response->header( "Cache-Control: private, must-revalidate, max-age=0" );
$response->header( "Cache-Control: private, must-revalidate, max-age=0" );
} else {
$response->header(
'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $config->get( 'LoggedOutMaxAge' ) ) . ' GMT'
);
$response->header(
"Cache-Control: private, must-revalidate, max-age={$config->get( 'LoggedOutMaxAge' )}"
);
}
} }
if ( $this->mLastModified ) { if ( $this->mLastModified ) {
$response->header( "Last-Modified: {$this->mLastModified}" ); $response->header( "Last-Modified: {$this->mLastModified}" );

View file

@ -3040,7 +3040,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
*/ */
public function testSendCacheControl( array $options = [], array $expectations = [] ) { public function testSendCacheControl( array $options = [], array $expectations = [] ) {
$output = $this->newInstance( [ $output = $this->newInstance( [
'LoggedOutMaxAge' => $options['loggedOutMaxAge'] ?? 0,
'UseCdn' => $options['useCdn'] ?? false, 'UseCdn' => $options['useCdn'] ?? false,
] ); ] );
@ -3083,10 +3082,7 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
'Default' => [], 'Default' => [],
'Logged out max-age' => [ 'Logged out max-age' => [
[ [
'loggedOutMaxAge' => 300, 'Cache-Control' => 'private, must-revalidate, max-age=0',
],
[
'Cache-Control' => 'private, must-revalidate, max-age=300',
], ],
], ],
'Cookies' => [ 'Cookies' => [
@ -3094,12 +3090,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
'cookie' => true, 'cookie' => true,
], ],
], ],
'Cookies with logged out max-age' => [
[
'loggedOutMaxAge' => 300,
'cookie' => true,
],
],
'Disable client cache' => [ 'Disable client cache' => [
[ [
'enableClientCache' => false, 'enableClientCache' => false,