diff --git a/RELEASE-NOTES-1.38 b/RELEASE-NOTES-1.38 index 62c8c739d73..477b4a6e1d2 100644 --- a/RELEASE-NOTES-1.38 +++ b/RELEASE-NOTES-1.38 @@ -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 not using escapeshellarg. This follows the direction of PHP 8.0, which sets 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. * … diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 0189be255eb..85333c9b338 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3276,15 +3276,6 @@ $wgCdnMaxageLagged = 30; */ $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 * this many seconds later via the job queue. This requires delayed job support. diff --git a/includes/OutputPage.php b/includes/OutputPage.php index f15a289d577..e61833cabff 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2506,20 +2506,11 @@ class OutputPage extends ContextSource { "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, after the max-age period. + # on revisiting the page. 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( "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' )}" - ); - } + $response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' ); + $response->header( "Cache-Control: private, must-revalidate, max-age=0" ); } if ( $this->mLastModified ) { $response->header( "Last-Modified: {$this->mLastModified}" ); diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 6158ed89a0c..65d98eecc68 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -3040,7 +3040,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase { */ public function testSendCacheControl( array $options = [], array $expectations = [] ) { $output = $this->newInstance( [ - 'LoggedOutMaxAge' => $options['loggedOutMaxAge'] ?? 0, 'UseCdn' => $options['useCdn'] ?? false, ] ); @@ -3083,10 +3082,7 @@ class OutputPageTest extends MediaWikiIntegrationTestCase { 'Default' => [], 'Logged out max-age' => [ [ - 'loggedOutMaxAge' => 300, - ], - [ - 'Cache-Control' => 'private, must-revalidate, max-age=300', + 'Cache-Control' => 'private, must-revalidate, max-age=0', ], ], 'Cookies' => [ @@ -3094,12 +3090,6 @@ class OutputPageTest extends MediaWikiIntegrationTestCase { 'cookie' => true, ], ], - 'Cookies with logged out max-age' => [ - [ - 'loggedOutMaxAge' => 300, - 'cookie' => true, - ], - ], 'Disable client cache' => [ [ 'enableClientCache' => false,