How to avoid caching for create-react-app
Asked Answered
B

2

4

I have created an app using create-react-app but it always loads old index.html from client

tried with meta tags to avoid cache in index.html but does not load new html always

index.html

Boar answered 25/12, 2018 at 13:36 Comment(3)
Could you be more elaborative on how are you starting your applicationPeraza
try Shift+F5 in Google ChromeMayoralty
but we cannot tell client / customer to do this, I am looking for solution that can be done progrmaticallyBoar
M
1

One way can be using the meta tags.<meta http-equiv='cache-control' content='no-cache'> <meta http-equiv='expires' content='0'> <meta http-equiv='pragma' content='no-cache'>

Myron answered 21/2, 2021 at 22:56 Comment(0)
V
-2

A very Rare condition. sometimes it may be because of your browser cache. there is an option in your Dom inspector which helps to disable caching. press F12 to toggle dom inspector. select the network tab Try the tick on.

Also make sure that you are editing and previewing the same index.html file.

enter image description here

Volnay answered 25/12, 2018 at 16:9 Comment(2)
Hi Dulara, Thanks for your answer, but we cannot tell client / customer to do this, I am looking for solution that can be done progrmaticallyBoar
Are you using a web caching service like Cloudflare in your distribution flow? Then try deleting the cache from there. hazaveh.net/2013/11/how-to-clear-cloudflare-cacheVolnay

© 2022 - 2024 — McMap. All rights reserved.