New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce `Service-Worker-Max-Age` header #721

annevk opened this Issue Jul 15, 2015 · 6 comments


None yet
6 participants

annevk commented Jul 15, 2015

@ehsan, please correct me if this didn't match what we discussed.

Since service workers use byte-for-byte comparison rather than HTTP cache semantics, there's a risk that when using a service worker library, it becomes harder to update, since you need to change the library code.

So it would be good that in addition to the byte-for-byte comparison, there's also a header that indicates when the browser should start ignoring the service worker being byte-for-byte identical.


This comment has been minimized.

ehsan commented Jul 15, 2015

That sounds like an accurate summary!


This comment has been minimized.


annevk commented Jul 20, 2015

The max-age is counted since installation.


This comment has been minimized.


slightlyoff commented Jul 21, 2015

There's pretty strong consensus from the F2F that this is worth doing in M2 (IIRC). Marking as such.


This comment has been minimized.

delapuente commented Jun 7, 2016

The are two perspectives here. One option is to extend byte-to-byte comparison to the whole imported scripts (importScripts) graph. If one node has change, update. The other is related with #839. The header Service-Worker-Force-Update proposed by @jakearchibald can be enough for this but it's hard to automatically calculate in the server cause it involves to calculate the import graph there.


This comment has been minimized.

collimarco commented Jul 9, 2016

One option is to extend byte-to-byte comparison to the whole imported scripts (importScripts) graph.

+1 for this

Personally I don't like the idea of having to return a custom header to force the refresh of the imported scripts.

This is because at Pushpad (which is a BaaS) we have a script that is imported in our customers' service workers. When we update our script we want the update to be propagated. However we cannot ask our customers to return custom headers for their service worker (some of them for example have simple websites or blogs powered by Wordpress).

I have described more extensively about our situation and why we need automatic updates of the imported scripts in this blog post.


This comment has been minimized.


jakearchibald commented Aug 3, 2016

We're going to check imported scripts by default #839 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment