shadowwalker / next-pwa

Zero config PWA plugin for Next.js, with workbox 🧰
MIT License
3.85k stars 322 forks source link

Custom Worker hash changes on every build #486

Closed danielpasch closed 1 year ago

danielpasch commented 1 year ago

Summary

Custom Worker uses the BUILD_ID as hash even if the content of the custom worker has not changed.

Versions

How To Reproduce

In order to further improve cache asset handling, the custom worker hash should only change if the worker itself had a change in content. The BUILD_ID is currently used as hash, and a new worker-*.js (with a modified hash) is created for each prod build. This is counterproductive for cache handling, since the content of the file has not changed. In our project we use a relatively static custom worker that rarely changes.

Expected Behaviors

The custom worker hash should only change if the content of the custom worker has also changed.

danielpasch commented 1 year ago

Fixed in this active fork https://github.com/DuCanhGH/next-pwa/issues/60