Skip to content
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

Introduce an cacheStartUrl configuration #296

Merged
merged 1 commit into from
Apr 17, 2022

Conversation

shrashiti
Copy link
Contributor

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.

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.
@meotimdihia
Copy link

@shadowwalker it may be related to the issue that I posted: #267 (comment)
Please take a look at this request.

@shadowwalker
Copy link
Owner

@meotimdihia But this looks confusing to me. What use case that you don't want to cache start url?

@meotimdihia
Copy link

meotimdihia commented Apr 10, 2022

@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:

  1. Start URL/Homepage (cached) => request API https://examples/api/getIndex1 => render

  2. if you change the response structure or remove the API https://examples/api/getIndex1 and update homepage => deploy production.

  3. But Start URL/homepage was cached in user browser (waiting for new service worker version) => users will see a broken website here.

@shadowwalker shadowwalker merged commit c176d85 into shadowwalker:master Apr 17, 2022
@meotimdihia
Copy link

Thanks for the merge.

@mrafei
Copy link

mrafei commented May 28, 2022

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.

Capture

@ArmenAivazian
Copy link

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.

Capture

add to the next.config.js field dynamicStartUrl: false

@meotimdihia
Copy link

@mrafei It works for me. You can follow these steps:

#267 (comment)

and yes, I think we have to use both cacheStartUrl and dynamicStartUrl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants