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

ServiceWorker keeps serving the old cached version #4304

Closed
ggregoire opened this issue Apr 13, 2018 · 2 comments
Closed

ServiceWorker keeps serving the old cached version #4304

ggregoire opened this issue Apr 13, 2018 · 2 comments

Comments

@ggregoire
Copy link

ggregoire commented Apr 13, 2018

Is this a bug report?

Yes

Environment

  1. Operating system: macOS
  2. Browser and version: Chrome 65

Steps to Reproduce

  1. deploy new build (S3 + CloudFront)
  2. open the app, the old version is served (expected behavior)
  3. normal refresh (n+1), still the old version. Refresh 15 times, still the old version
  4. hard refresh (cmd shift R), the new version is served
  5. normal refresh, the old version is served again
  6. hard refresh, the new version is served
  7. normal refresh, the old version is served again…

Expected Behavior

Serve the new version at n+1 with a normal refresh.

I unregistered the SW for now.

@Timer
Copy link
Contributor

Timer commented Apr 14, 2018

You need to configure cloudfront to not send caching headers for the service-worker.js file.
See bullet 5 here: https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#offline-first-considerations.

@Timer Timer closed this as completed Apr 14, 2018
@annjawn
Copy link

annjawn commented Nov 20, 2018

That link doesn't point to the correct documentation. I found this https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app but the point 5 talks about testing SW locally.

@lock lock bot locked and limited conversation to collaborators Jan 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants