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

Expanded on the update() Note: #616

Closed
wants to merge 1 commit into from
Closed

Conversation

jeffposnick
Copy link
Contributor

@jakearchibald @slightlyoff:

Here's my take on elaborating the update() Note, to clarify that, by default, the browser's HTTP cache is consulted for an unexpired copy of the service worker script, and that update() skips the HTTP cache.

I hadn't previously been clear on whether it was the browser HTTP cache that was consulted or some service worker-specific cache—the impression that I got was that service workers scripts were always cached for 24 hours, and the only way to achieve a quicker cache expiration was to call update().

@jakearchibald
Copy link
Contributor

When loading a registered service worker script, the UA normally checks the HTTP cache for an unexpired copy

This is done when loading a client request occurs, rather than when the service worker script is loaded. Eg, two controlled document loads would cause two updates, even if the SW didn't shut down in between, therefore only loaded once.

update()'s behavior is conceptually the same as what the UA does a maximum once every 24 hours on its own, to prevent service worker scripts from being cached for longer than a day.

Can't decide if "maximum" is misleading. I mean, the UA can check for updates more than once every 24hrs.

@jungkees
Copy link
Collaborator

@jeffposnick thanks for having suggested a better wording. Recently after the latest f2f, it has been sorted out that update() obeys the same browser cache rule as other update paths: #514 (comment). And the note has been removed from the text as such.

For

I hadn't previously been clear on whether it was the browser HTTP cache that was consulted or some service worker-specific cache

The fetched service worker script resource is stored apart from the browser cache and has no expiration in and of itself until it's replaced by a new version through one of the update paths.

@jungkees jungkees closed this Aug 27, 2015
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

Successfully merging this pull request may close these issues.

3 participants