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

[PWA] /img/icons cache? #2975

Closed
frizar opened this Issue Nov 18, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@frizar
Copy link

commented Nov 18, 2018

Version

3.1.1

Reproduction link

https://test-app-8134f.firebaseapp.com/

Node and OS info

node 10.13.0, npm 6.4.1, macOS 10.14, windows 10

Steps to reproduce

Im new in PWA plugin, so i have a question. Is "/img/icons" folder not cached by service worker by default and why?
I created new app with PWA option, deploy it to firebase and i see that any files from "/img/icons" not cached...
https://test-app-8134f.firebaseapp.com/ this is my result. Open dev console, enable Offline mode, reload page.
Screenshot: http://joxi.ru/52aR4oxSE4j1YA
Same problem with manifest.json. It is correct behavior?

What is expected?

Any files from public folder should be cached by default

What is actually happening?

/img/icons folder not cached, also manifest.json not cached


Please tell me if im wrong and explain me why this happens and how to fix(?) it.
Thanks! Sorry for my English, btw.

@sodatea

This comment has been minimized.

Copy link
Member

commented Nov 20, 2018

Because icons are excluded in the default workbox settings:

const defaultOptions = {
exclude: [
/\.map$/,
/img\/icons\//,
/favicon\.ico$/,
/manifest\.json$/
]
}

#769 (comment)

The request that a browser makes for either a registered favicon or for the home screen icon bypasses the service worker, so there's no benefit from caching them.

manifest.json was excluded as we followed workbox's default config. (They'll change the behavior in the upcoming v4, though. GoogleChrome/workbox#1679)

These default options can be overridden by configuring the pwa.workboxOptions field in vue.config.js. https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-pwa#configuration

@sodatea sodatea closed this Nov 20, 2018

@frizar

This comment has been minimized.

Copy link
Author

commented Nov 20, 2018

@sodatea oh, thank you very much! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.