From: Roan Kattouw Date: Mon, 1 Nov 2010 20:48:30 +0000 (+0000) Subject: (bug 25573) Send Cache-Control: must-revalidate in debug mode X-Git-Tag: 1.31.0-rc.0~34136 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=a6b765ffd131f4bf520ef04d7e93d27982d08f0c;p=lhc%2Fweb%2Fwiklou.git (bug 25573) Send Cache-Control: must-revalidate in debug mode --- diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 128156b00d..52520d605b 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -293,8 +293,12 @@ class ResourceLoader { header( 'Content-Type: ' . ( $context->getOnly() === 'styles' ? 'text/css' : 'text/javascript' ) ); header( 'Last-Modified: ' . wfTimestamp( TS_RFC2822, $mtime ) ); - header( "Cache-Control: public, max-age=$maxage, s-maxage=$smaxage" ); - header( 'Expires: ' . wfTimestamp( TS_RFC2822, min( $maxage, $smaxage ) + time() ) ); + if ( $context->getDebug() ) { + header( 'Cache-Control: must-revalidate' ); + } else { + header( "Cache-Control: public, max-age=$maxage, s-maxage=$smaxage" ); + header( 'Expires: ' . wfTimestamp( TS_RFC2822, min( $maxage, $smaxage ) + time() ) ); + } // If there's an If-Modified-Since header, respond with a 304 appropriately $ims = $context->getRequest()->getHeader( 'If-Modified-Since' );