Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service worker is to eager to load .js and .gz #2254

Closed
jorkvist opened this issue Jan 18, 2019 · 3 comments
Closed

Service worker is to eager to load .js and .gz #2254

jorkvist opened this issue Jan 18, 2019 · 3 comments
Assignees
Milestone

Comments

@jorkvist
Copy link

Current behavior

SW loads both .js and js.gz version:
image

Expected behavior

Just load one version of the file

Steps to reproduce the issue

First load of a page.

Repository

1.7

Can you handle fixing this bug by yourself?

NO

Environment details

  • Browser: chrome latest
  • OS: mac os
  • Node:

Additional information

Tested on https://stage.ribatex.se/
Also the .gziped version looks a bit wierd in devtools and missing "encoding type": gzip
image

@filrak
Copy link
Collaborator

filrak commented Jan 21, 2019

@patzick can you update the precache regex in the meantime ?

@pkarw
Copy link
Collaborator

pkarw commented Feb 2, 2019

@patzick is this fixed already?

@opensrc0
Copy link

opensrc0 commented Jul 23, 2020

Filterout the files you dont need. Solution is here.

workbox.precaching.precacheAndRoute((self.__precacheManifest || []).filter((e) => {
  if (
    e &&
    e.url &&
    e.url.match &&
    e.url.match(/(assetlinks.json|offline.html.br|manifest.json|.js.br|.css.br|.jpg|.png|.svg|.webp|.gif|.ico|.woff2)/)
  ) {
    return true;
  }
  return false;
}));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants