-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Force web to reload script or manifest.json after new build #3372
Comments
Probably your server is set up to cache all javascript files, including service worker itself for long period. Steps
BTW: You'll get more relevant replies on SO, not here More info here: vuejs-templates/pwa#70 or here |
Please see this section: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#making-a-progressive-web-app In particular, this point:
If this is still causing you trouble you can disable caching completely: Also paging @jeffposnick to help explaining. |
Right—the guidance at https://stackoverflow.com/questions/38843970/service-worker-javascript-update-frequency-every-24-hours/38854905#38854905 and elsewhere is still relevant. The good news is that Firefox 57+ defaults to ignoring the |
First I'm sorry to post this in here. I really need to take care this issue. Because the web app is live.
I already post on SO, and Facebook Group but still can't get any solution.
I'm currently experiencing every time I build script for production , the browser won't load any new JS.
The only way to make it work is clear cache manually (not all user know how to do this).
I've tried to put
window.location.reload(true)
but it still won't fetch latest JS.and then I try to put this on my index.html
none of them is working.
The browser won't load any new JS especially for mobile (Chrome Android, Firefox. Again I need to clear data manually so the web reload the new version)
I'm using Cloudflare and I already try to purge cache few times.
I can't use JS versioning because create-react-app using manifest.json file.
Any other solution to force the browser load new script?
Thanks
Environment
node -v
: 8.8.1npm -v
: 5.5.1yarn --version
(if you use Yarn): 1.2.1npm ls react-scripts
(if you haven’t ejected): 1.0.14Then, specify:
The text was updated successfully, but these errors were encountered: