Skip to content

docs(service-worker): clarify how applicationMaxAge is measured - #71759

Open
erkamyaman wants to merge 1 commit into
angular:mainfrom
erkamyaman:docs-service-worker-application-max-age
Open

erkamyaman wants to merge 1 commit into
angular:mainfrom
erkamyaman:docs-service-worker-application-max-age

Conversation

@erkamyaman

Copy link
Copy Markdown
Contributor

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

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
@pullapprove
pullapprove Bot requested a review from atscott October 31, 2026 21:34
@angular-robot angular-robot Bot added area: docs Related to the documentation area: service-worker Issues related to the @angular/service-worker package labels Oct 31, 2026
@ngbot ngbot Bot added this to the Backlog milestone Oct 31, 2026
@erkamyaman

Copy link
Copy Markdown
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

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

Labels

area: docs Related to the documentation area: service-worker Issues related to the @angular/service-worker package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(service-worker): applicationMaxAge is counted from the build timestamp, and the default is not documented

1 participant