The images in /dist/assets are not cached
See original GitHub issueI changed the SVG image in the demo to PNG, and then placed it in /src/assets
. This image will not be displayed offline
I tried to write ['*.png']
in includeAssets
, it didn’t seem to work
I uploaded the demo code here
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Guide for Caching and HTTP Cache Headers for Static Content
HTTP cache headers for images and other static content. In almost all cases, static assets like images, JS, and CSS, do not change...
Read more >using with file-loader, files are not builded if in cache ... - GitHub
While using with file-loader , if output directory does not content assets folder — get those files from cache and put in assets...
Read more >How to enable browser caching of assets (images/JS/CSS) in ...
I would like the browser to cache these aggressively, so that the majority of pageloads will not re-requests these assets. The default appears...
Read more >Asset Caching - Expo Documentation
To download and cache the images saved to the local filesystem, use Asset. fromModule(image). downloadAsync() .
Read more >Assets & caching - Infinum
Application build files in dist directory include: Fingerprinted JS and CSS chunks; Copied assets directory. Individual asset files are NOT ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@akirarika both are equivalent, the main diference is that with your solution, you sould take care including all assets.
includeAssets
will add the result on[workbox/injectManifest].additionalManifestEntries
instead manipulating[workbox/injectManifest].globPatterns
: https://github.com/antfu/vite-plugin-pwa/blob/main/src/assets.ts#L32, https://github.com/antfu/vite-plugin-pwa/blob/main/src/assets.ts#L58 and https://github.com/antfu/vite-plugin-pwa/blob/main/src/assets.ts#L101Regarding the warning message, I see now my confusion.
This note:
Might be more clear if it said:
Sorry for my confusion on that.