-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Runtime caching caches at second reload #76
Comments
@ProDeSquare can you try this GoogleChrome/workbox#1415 (comment) ? You'll need to use any of the virtual modules calling the |
This is the if('serviceWorker'in navigator){window.addEventListener('load',()=>{navigator.serviceWorker.register('/sw.js',{scope:'/'})})} Should I delay it even further? Edit: I've started seeing the pattern. My API requests are lazy loaded. |
For testing: Now my API requests are delayed 5 seconds after the page load. Result:
|
I'm using
vite-plugin-pwa
with myReact.js
,Typescript
, andSWC
app. I've noticed in the dev tools it doesn't cache my API requests until the second reload. I tried a solution from this link (from StackOverflow) but it didn't help. I implemented this with:but it still caches the API response on the second reload. I also tried
dns-prefetch
andpreconnect
(according to the official documentation) with the API host but it had no effect. Is there any workaround for that, I'm using theGenerateSW
method.The text was updated successfully, but these errors were encountered: