Snap
Snap copied to clipboard
Progressive web app caching interfering with debugging
Running Snap! only on localhost it seemed as if it was losing some changes I made today. And yet the source files looked fine. In Chrome's dev tab called "Application" I see it had cached a localhost version of a Snap! PWA. Deleting it fixed my problems. But I worry this will reappear.
PWAs are great but is there a way for them to not cache any localhost files? Perhaps sw.js should use absolute URLs instead of the relative ones it currently lists.
Note I didn't install the PWA. I.e. I did not click on this:
I don't know how I activated the PWA caching.
The caching seems to be on by default. In development you seem to need to hard refresh more. :/ maybe we can add an exception for localhost?
The alternative is to keep incrementing the version number in sw.js
There are extension to block SW registration for selected site (Chrome, Firefox). The simplest one https://chrome.google.com/webstore/detail/block-service-workers/ceokjgeibfjfcboemhdpkdalankbmnej https://github.com/clod81/block_service_workers