From a6b765ffd131f4bf520ef04d7e93d27982d08f0c Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 1 Nov 2010 20:48:30 +0000 Subject: [PATCH] (bug 25573) Send Cache-Control: must-revalidate in debug mode --- includes/resourceloader/ResourceLoader.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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' ); -- 2.20.1