-
Notifications
You must be signed in to change notification settings - Fork 27.1k
feat(service-worker): add staleWhileRevalidate strategy #20402
Copy link
Copy link
Closed
Labels
area: service-workerIssues related to the @angular/service-worker packageIssues related to the @angular/service-worker packagefeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfreq1: low
Milestone
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
The service worker only supports networkFirst and cacheFirst caching for DataGroups.
Expected behavior
Also support staleWhileRevalidate Strategy.
As shown here: https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#stale-while-revalidate
What is the motivation / use case for changing the behavior?
This would help with slow data requests, that can not be cached for a long time. They would be way faster while still being al most up to date.
I workaround for now would be to limit the cache time in order to catch repetitive requests, but staleWhileRevalidate is preferable in my opinion.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: service-workerIssues related to the @angular/service-worker packageIssues related to the @angular/service-worker packagefeatureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issuesfreq1: low