From: Ori Livneh Date: Fri, 3 Jul 2015 02:20:41 +0000 (-0700) Subject: Add MediaWiki-Timestamp header to ResourceLoader requests X-Git-Tag: 1.31.0-rc.0~10767^2 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=3d5aca4a406424bf69016f9c7c4a94b317b62d25;p=lhc%2Fweb%2Fwiklou.git Add MediaWiki-Timestamp header to ResourceLoader requests To help distinguish cache hits from cache misses, send a MediaWiki-Timestamp header on ResourceLoader responses, indicating the current time as fractional seconds since epoch, with microsecond precision. Change-Id: I954a96ced1435a47d458de12411b257fe6b4ea34 --- diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 5d0ed3c51b..54cc6e5b1d 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -813,6 +813,11 @@ class ResourceLoader implements LoggerAwareInterface { $exp = min( $maxage, $smaxage ); header( 'Expires: ' . wfTimestamp( TS_RFC2822, $exp + time() ) ); } + + // Send the current time expressed as fractional seconds since epoch, + // with microsecond precision. This helps distinguish hits from misses + // in edge caches. + header( 'MediaWiki-Timestamp: ' . microtime( true ) ); } /**