Bad SW Caching of HTML
See original GitHub issueIs this a bug report?
Yes
Did you try recovering your dependencies?
Yes. Pretty sure this is a configuration issue
Which terms did you search for in User Guide?
Cache, Service Worker, SWPrecacheWebpackPlugin, Precache
Environment
Mac OS, Node 8.10.x
Steps to Reproduce
- Include a second
.html
file in the/public
directory (I will usesample.html
for this report) - Build the Project
- Load the site from the
index.html
- Attempt to load
sample.html
, such as in an<iframe>
Expected Behavior
The sample.html
should be served
Actual Behavior
The index.html
is loaded by the service worker
I also want to note that sample.html
is not included in the asset-manifest.json
, which seems like it might be an issue. sample.html
is also not included in the SWPrecache static cache files (the ones that get hashed and precached inside the service-worker.js
output file).
Notes
I have ejected. I am prepared to alter my config in any way necessary to get this working.
I am asking here instead of SWPrecache because the amount of “create-react-app” configuration will make it much harder for them to diagnose.
I have tried adding the folliwing to the precache config
mergeStaticsConfig: true,
staticFileGlobs: ['public/sample.html'],
stripPrefix: 'public/',
...
// and in runtimeCaching
{
urlPattern: '/sample.html',
handler: 'networkOnly'
},
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
idiots
how to upgrade to v2 with already ejected app?