PERF: Improve workbox loading strategy (#22019)

Previously workbox JS was vendored into our git repository, and would be loaded from the `public/javascripts` directory with a 1 day cache lifetime. The main aim of this commit is to add 'cachebuster' to the workbox URL so that the cache lifetime can be increased.

- Remove vendored copies of workbox.
- Use ember-cli/broccoli to collect workbox files from node_modules into assets/workbox-{digest}
- Add assets to sprockets manifest so that they're collected from the ember-cli output directory (and uploaded to s3 when configured)

Some of the sprockets-related changes in this commit are not ideal, but we hope to remove sprockets in the not-too-distant future.
This commit is contained in:
David Taylor
2023-06-09 11:14:11 +01:00
committed by GitHub
parent dbf3ff1738
commit 9c926ce645
34 changed files with 126 additions and 4820 deletions

View File

@ -87,32 +87,6 @@ def dependencies
source: "@discourse/moment-timezone-names-translations/locales/.",
destination: "moment-timezone-names-locale",
},
{ source: "workbox-sw/build/.", destination: "workbox", public: true, skip_versioning: true },
{
source: "workbox-routing/build/.",
destination: "workbox",
public: true,
skip_versioning: true,
},
{ source: "workbox-core/build/.", destination: "workbox", public: true, skip_versioning: true },
{
source: "workbox-strategies/build/.",
destination: "workbox",
public: true,
skip_versioning: true,
},
{
source: "workbox-expiration/build/.",
destination: "workbox",
public: true,
skip_versioning: true,
},
{
source: "workbox-cacheable-response/build/.",
destination: "workbox",
skip_versioning: true,
public: true,
},
{
source: "squoosh/codecs/mozjpeg/enc/mozjpeg_enc.js",
destination: "squoosh",