webamp icon indicating copy to clipboard operation
webamp copied to clipboard

Consider setting header: cache-control: no-cache

Open msikma opened this issue 7 years ago • 3 comments

Just now when I decided to try Webamp's new Milkdrop feature (which is amazing), I had some trouble finding it. Wasn't until I refreshed the page that I realized I was seeing an older version.

It's strange, because I see cache-control: public, max-age=0, must-revalidate in the list of headers sent from Webamp and I thought that would be enough. Maybe it must be set to Cache-Control: no-cache to force the client to always check whether there is a new version.

msikma avatar Jul 18 '18 15:07 msikma

This is probably due to the service workers setup that we have, which enables offline mode. If you've loaded the page previously, it will immediately load a cached version from your browser. I doubt anyone is actually using offline mode, so it might be better to just remove the service worker caching and avoid the confusion of having to reload to get the newest version.

Actually, the best approach would be to load from the service worker, but somehow tell the user when a new version is available. I'll look into this at some point.

captbaritone avatar Jul 18 '18 16:07 captbaritone

https://medium.com/progressive-web-apps/pwa-create-a-new-update-available-notification-using-service-workers-18be9168d717

captbaritone avatar Jul 19 '18 22:07 captbaritone

I think we can use this: https://developers.google.com/web/tools/workbox/modules/workbox-broadcast-cache-update

captbaritone avatar Jul 27 '18 04:07 captbaritone