From: Timo Tijhof Date: Mon, 25 Jun 2018 18:30:48 +0000 (+0100) Subject: resourceloader: Update StartUpModule to use file hash instead of mtime X-Git-Tag: 1.34.0-rc.0~4968^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=14d8291c5e1772fe1ec0b82e7b088d35c89f50d7;p=lhc%2Fweb%2Fwiklou.git resourceloader: Update StartUpModule to use file hash instead of mtime This was overlooked as part of the whole shift from timestamps to file hashes (T94074, f37cee996e, T104950, 28f6d7fbde). The key name and method call here matches that of FileModule. The impact of this still using mtimes was fairly low, given: * The startup module is only cached for 5 minutes. * The startup module's hash varies on "everything" which includes wgVersion, as such, when a new branch is cut and cloned and this file's timestamp is reset, there will still be other factors causing the overall hash to vary. As such, this change is unlikely to improve 200-304 response ratio. Change-Id: I6543fb75575e9a793a7fc93e15d2f3e0b5a04342 --- diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 120f559fc6..b051d40e15 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -429,8 +429,8 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { // Detect changes to the module registrations 'moduleHashes' => $this->getAllModuleHashes( $context ), - 'fileMtimes' => [ - filemtime( "$IP/resources/src/startup.js" ), + 'fileHashes' => [ + $this->safeFileHash( "$IP/resources/src/startup.js" ), ], ]; return $summary;