https://github.com/angular/angular
Revision 73b0275dc2dd64bbb39be3a8079b418a40e89cfd authored by George Kalpakas on 23 June 2021, 12:27:50 UTC, committed by Jessica Janiuk on 24 June 2021, 16:55:32 UTC
This commit improves the cache names generated by the ServiceWorker by
making them shorter and non-repetitive. In particular, the following
changes are made:

- Data-group cache names no longer include the `dynamic` infix, since it
  does not add any value.
  Before: `ngsw:<...>:data:dynamic:<...>`
  After:  `ngsw:<...>:data:<...>`

- `CacheDatabase` table names no longer include the `ngsw:<path>` prefix
  twice.
  Before: `ngsw:<path>:db:ngsw:<path>:<...>`
  After:  `ngsw:<path>:db:<...>`

NOTE 1:
This change will result in different cache names being generated for the
same app-versions with the new SericeWorker script. This means that some
of the previously cached data will need to be re-downloaded (because the
ServiceWorker will not be able to re-use the old caches), but that
should be transparent for the end user.
While possible, adding logic to allow the ServiceWorker to retrieve data
from the old caches is not worth the extra complecity and maintenance
cost.

NOTE 2:
Generating different cache names for some of the caches means that the
ServiceWorker will not be able to clean-up some of the old caches. This
will be taken care of in a subsequent commit that will rework the
clean-up logic to be more robust (covering changes such as this one and
other edgecases).

PR Close #42622
1 parent 7507ed2
History
Tip revision: 73b0275dc2dd64bbb39be3a8079b418a40e89cfd authored by George Kalpakas on 23 June 2021, 12:27:50 UTC
fix(service-worker): improve ServiceWorker cache names (#42622)
Tip revision: 73b0275
File Mode Size
.circleci
.devcontainer
.github
.husky
.ng-dev
.vscode
.yarn
aio
dev-infra
docs
goldens
integration
modules
packages
scripts
third_party
tools
.bazelignore -rw-r--r-- 4.2 KB
.bazelrc -rw-r--r-- 6.4 KB
.bazelversion -rw-r--r-- 213 bytes
.clang-format -rw-r--r-- 73 bytes
.editorconfig -rw-r--r-- 245 bytes
.gitattributes -rw-r--r-- 314 bytes
.gitignore -rw-r--r-- 843 bytes
.gitmessage -rw-r--r-- 7.2 KB
.mailmap -rw-r--r-- 51 bytes
.npmrc -rw-r--r-- 21 bytes
.nvmrc -rw-r--r-- 8 bytes
.prettierrc -rw-r--r-- 157 bytes
.pullapprove.yml -rw-r--r-- 48.1 KB
.yarnrc -rw-r--r-- 130 bytes
BUILD.bazel -rw-r--r-- 2.0 KB
CHANGELOG.md -rw-r--r-- 890.3 KB
CODE_OF_CONDUCT.md -rw-r--r-- 1.1 KB
CONTRIBUTING.md -rw-r--r-- 15.5 KB
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 4.7 KB
WORKSPACE -rw-r--r-- 1.9 KB
browser-providers.conf.js -rw-r--r-- 8.4 KB
gulpfile.js -rw-r--r-- 812 bytes
karma-js.conf.js -rw-r--r-- 8.0 KB
package.json -rw-r--r-- 8.5 KB
renovate.json -rw-r--r-- 2.7 KB
test-events.js -rw-r--r-- 259 bytes
test-main.js -rw-r--r-- 9.4 KB
tslint.json -rw-r--r-- 2.8 KB
yarn.lock -rw-r--r-- 617.7 KB
yarn.lock.readme.md -rw-r--r-- 1.3 KB

README.md

back to top