Re: [w3c/ServiceWorker] consider fetching service worker scripts with no-cache by default (#893)

I just ran in to this. There definitely needs to be a way to force updates for fetching the SW script. I have to reiterate that as middleware/framework developers we are always developing for servers we don't control, so tweaking HTTP headers is simply not possible. Note this is also the case if you don't control the host (e.g. Dropbox public folder, Neocities, Github pages etc).

I just tried testing on a server which defaults all .js files to cache with a max-age of 50 days, presumably set up to use versioned URLs. Of course there's no sensible way to use versioned URLs on the sw.js script if the main page is cached by the SW itself, so I kept getting the stale sw.js returned from cache with no apparent workaround other than to change the server configuration or wait 24 hours. In our case neither are good options! I don't mind which way you choose to default this, but I think it's essential to have some way of saying "bypass cache for SW updates".

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/893#issuecomment-244793881

Received on Monday, 5 September 2016 18:06:06 UTC