Repository navigation
docs(service-worker): clarify how applicationMaxAge is measured - #71759
Open
erkamyaman wants to merge 1 commit into
Open
erkamyaman wants to merge 1 commit into
erkamyaman wants to merge 1 commit into
Conversation
The applicationMaxAge docs and schema description read as if the age were counted from when files were cached on the device. The service worker actually compares the age against the manifest timestamp, which is set when ngsw.json is generated at build time. Once the build is older than applicationMaxAge, every request bypasses the cache and goes to the network, even when no newer version has been deployed, so the application does not work offline until a new build is deployed. When the property is omitted, there is no maximum age. Update the guide and the JSON schema description to state this. The format check requires every touched file to be formatted, so this also formats `schema.json`, which was not formatted on main. Fixes angular#71720
Contributor
Author
|
@JeanMeche this is #71721 reopened from a new branch, since GitHub closed the original when I force-pushed after my fork changed. Only change is formatting schema.json so lint passes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The applicationMaxAge docs and schema description read as if the age were counted from when files were cached on the device. The service worker actually compares the age against the manifest timestamp, which is set when ngsw.json is generated at build time.
Once the build is older than applicationMaxAge, every request bypasses the cache and goes to the network, even when no newer version has been deployed, so the application does not work offline until a new build is deployed. When the property is omitted, there is no maximum age.
Update the guide and the JSON schema description to state this.
The format check requires every touched file to be formatted, so this also formats
schema.json, which was not formatted on main.Fixes #71720