Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Introduce `Service-Worker-Max-Age` header #721
@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.
The are two perspectives here. One option is to extend byte-to-byte comparison to the whole imported scripts (
+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.