resourceloader: Update StartUpModule to use file hash instead of mtime
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 25 Jun 2018 18:30:48 +0000 (19:30 +0100)
committerKrinkle <krinklemail@gmail.com>
Mon, 25 Jun 2018 18:40:30 +0000 (18:40 +0000)
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

includes/resourceloader/ResourceLoaderStartUpModule.php

index 120f559..b051d40 100644 (file)
@@ -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;