Closed shrashiti closed 2 years ago
@shadowwalker it may be related to the issue that I posted: https://github.com/shadowwalker/next-pwa/issues/267#issuecomment-925835325 Please take a look at this request.
@meotimdihia But this looks confusing to me. What use case that you don't want to cache start url?
@meotimdihia But this looks confusing to me. What use case that you don't want to cache start url?
Thanks for looking into this issue. Service worker doesn't always install immediately to the browser. On some devices, I even take hours to install the new version. (Even months, I have seen it in the Sentry )
For example:
Start URL/Homepage (cached) => request API https://examples/api/getIndex1 => render
if you change the response structure or remove the API https://examples/api/getIndex1 and update homepage => deploy production.
But Start URL/homepage was cached in user browser (waiting for new service worker version) => users will see a broken website here.
Thanks for the merge.
Hi, start_url is still being cached for my project. Even though I set cacheStartUrl: false
. I'm on next-pwa 5.5.2
and next 12.1.6
.
Any suggestions how to fix? Thanks.
Hi, start_url is still being cached for my project. Even though I set
cacheStartUrl: false
. I'm onnext-pwa 5.5.2
andnext 12.1.6
. Any suggestions how to fix? Thanks.
add to the next.config.js
field dynamicStartUrl: false
@mrafei It works for me. You can follow these steps:
https://github.com/shadowwalker/next-pwa/issues/267#issuecomment-908151945
and yes, I think we have to use both cacheStartUrl
and dynamicStartUrl
With cacheStartUrl users can decide if they want to cache or not startUrl. It is the same as dynamicStartUrl but with dynamicStartUrl serviceWorker will send a request extra.