Skip to content

Introduce an cacheStartUrl configuration#296

Merged
shadowwalker merged 1 commit into
shadowwalker:masterfrom
shrashiti:patch-1
Apr 17, 2022
Merged

Introduce an cacheStartUrl configuration#296
shadowwalker merged 1 commit into
shadowwalker:masterfrom
shrashiti:patch-1

Conversation

@shrashiti
Copy link
Copy Markdown
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
Copy Markdown

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

@shadowwalker
Copy link
Copy Markdown
Owner

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

@meotimdihia
Copy link
Copy Markdown

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 force-pushed the master branch 3 times, most recently from ae01de5 to 51686de Compare April 17, 2022 00:46
@shadowwalker shadowwalker merged commit c176d85 into shadowwalker:master Apr 17, 2022
@meotimdihia
Copy link
Copy Markdown

Thanks for the merge.

@mrafei
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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

#267 (comment)

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

mnphpexpert added a commit to mnphpexpert/next-pwa that referenced this pull request Sep 2, 2024
Introduce an cacheStartUrl configuration
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.

5 participants