You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue or Feature Request Description:
My website is a single-page application, and Nginx uses try_files to return index.html for various routes. I've pre-cached index.html using Workbox. However, I've noticed that when I first visit a route, there is an initial document request, and then the service worker also makes another fetch request for index.html. These are two different requests with different durations,
and the service worker's fetch looks does not use the cache from the initial document request.( because i see the waterfall timeline in chrome devtool)
Is this expected behavior? How can I fix this issue so that only one request is necessary?
The text was updated successfully, but these errors were encountered:
eret9616
changed the title
How to correctly use of precacheAndRoute to serve index.html?
How to correctly use of precacheAndRoute to serve index.html ? (how to precache current html?)
Jul 19, 2024
Library Affected:
workbox-sw, workbox-build
Browser & Platform:
"all browsers"
Issue or Feature Request Description:
My website is a single-page application, and Nginx uses try_files to return index.html for various routes. I've pre-cached index.html using Workbox. However, I've noticed that when I first visit a route, there is an initial document request, and then the service worker also makes another fetch request for index.html. These are two different requests with different durations,
and the service worker's fetch looks does not use the cache from the initial document request.( because i see the waterfall timeline in chrome devtool)
Is this expected behavior? How can I fix this issue so that only one request is necessary?
nginx.conf:
workbox-config.js
service-worker.js:
The text was updated successfully, but these errors were encountered: