Skip to content
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

Closed
annevk opened this issue Jul 15, 2015 · 6 comments
Closed

Introduce Service-Worker-Max-Age header #721

annevk opened this issue Jul 15, 2015 · 6 comments
Milestone

Comments

@annevk
Copy link
Member

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.

@ehsan
Copy link

ehsan commented Jul 15, 2015

That sounds like an accurate summary!

@annevk
Copy link
Member Author

annevk commented Jul 20, 2015

The max-age is counted since installation.

@slightlyoff
Copy link
Contributor

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

@delapuente
Copy link

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.

@collimarco
Copy link

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.

@jakearchibald
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants