Page MenuHomePhabricator

wgSquidMaxage of 0 (zero) not allowed.
Closed, DeclinedPublic

Description

Author: fredan-bugs

Description:
if you put wqSquidMaxage in your Localsettings.php to zero, then you aren't able to cache pages in Squid.

As it is now, you will get the header "Cache-Control: private, must-revalidate, max-age=0".

With my patch of one char, you get the following header "s-maxage=0, must-revalidate, max-age=0" which still allows
Squid to cache the page after validateing the page with Mediawiki.

  • OutputPage.php 2007-02-22 22:09:20.054349784 +0100

+++ OutputPage.php.org 2007-02-21 03:20:31.000000000 +0100
@@ -477,7 +477,7 @@

$wgRequest->response()->header( 'Vary: Accept-Encoding, Cookie' );
if( !$this->uncacheableBecauseRequestvars() && $this->mEnableClientCache ) {
        if( $wgUseSquid && ! isset( $_COOKIE[ini_get( 'session.name') ] ) &&
  • ! $this->isPrintable() && $this->mSquidMaxage >= 0 )

+ ! $this->isPrintable() && $this->mSquidMaxage != 0 )

{
        if ( $wgUseESI ) {
                # We'll purge the proxy cache explicitly, but require end user agents

Version: unspecified
Severity: normal
OS: Linux
Platform: Other

Details

Reference
bz9071

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:37 PM
bzimport set Reference to bz9071.
bzimport added a subscriber: Unknown Object (MLST).

... Correct me if I'm wrong, but isn't this expected? I would assume that
setting $wgSquidMaxage = 0 would mean that you NEVER want ANYTHING cached...
which is what happens.

Why would you put $wgSquidMaxage = 0 if you wanted pages cached?

Marking WONTFIX per comment #1.