The following logic is currently used to calculate the value for revision when building the list of additionalManifestEntries that is passed down into the Workbox Webpack Plugin:
|
const getRevision = (file) => |
|
crypto.createHash("md5").update(Buffer.from(file)).digest("hex"); |
Unfortunately, file in this case is a relative file URL and not the actual contents of the file. This means that the MD5 hash that is being calculated is for a string such as "public/android-chrome-192x192.png" and not the actual binary contents of the file. This means that if the contents of the file changes it will never actually be recognized by the next version of the app and the older version will continue to be served out of the service worker's cache.
For this plugin to actually work correctly for the static files, it would actually have to read the contents of the file and get the MD5 hash for the actual contents to use as the revision. Otherwise, the only thing it seems to actually be doing right now for is picking up on new or renamed files.
The following logic is currently used to calculate the value for
revisionwhen building the list ofadditionalManifestEntriesthat is passed down into the Workbox Webpack Plugin:next-with-workbox/index.js
Lines 8 to 9 in e5a222a
Unfortunately,
filein this case is a relative file URL and not the actual contents of the file. This means that the MD5 hash that is being calculated is for a string such as"public/android-chrome-192x192.png"and not the actual binary contents of the file. This means that if the contents of the file changes it will never actually be recognized by the next version of the app and the older version will continue to be served out of the service worker's cache.For this plugin to actually work correctly for the static files, it would actually have to read the contents of the file and get the MD5 hash for the actual contents to use as the
revision. Otherwise, the only thing it seems to actually be doing right now for is picking up on new or renamed files.