r75827 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75826‎ | r75827 | r75828 >
Date:20:48, 1 November 2010
Author:catrope
Status:ok
Tags:
Comment:
(bug 25573) Send Cache-Control: must-revalidate in debug mode
Modified paths:
  • /trunk/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/resourceloader/ResourceLoader.php
@@ -293,8 +293,12 @@
294294
295295 header( 'Content-Type: ' . ( $context->getOnly() === 'styles' ? 'text/css' : 'text/javascript' ) );
296296 header( 'Last-Modified: ' . wfTimestamp( TS_RFC2822, $mtime ) );
297 - header( "Cache-Control: public, max-age=$maxage, s-maxage=$smaxage" );
298 - header( 'Expires: ' . wfTimestamp( TS_RFC2822, min( $maxage, $smaxage ) + time() ) );
 297+ if ( $context->getDebug() ) {
 298+ header( 'Cache-Control: must-revalidate' );
 299+ } else {
 300+ header( "Cache-Control: public, max-age=$maxage, s-maxage=$smaxage" );
 301+ header( 'Expires: ' . wfTimestamp( TS_RFC2822, min( $maxage, $smaxage ) + time() ) );
 302+ }
299303
300304 // If there's an If-Modified-Since header, respond with a 304 appropriately
301305 $ims = $context->getRequest()->getHeader( 'If-Modified-Since' );

Status & tagging log