Deployed online web application requires hard upgrade

Loaded using create-react-app (v1.0.13). Whenever I update the source code and reinstall, users need a hard update to get new content. I included the header without a cache in index.html:

<meta http-equiv="Cache-Control" content="no-store" />

& Disabled provided service workers. Also change the name of the .js filename (and the link in index.html) in the assembly folder before deployment.

+7
source share
2 answers

I was able to remove caching by doing the following:

  • adding the following to index.html <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" />
  • insert next in js import { unregister } from './registerServiceWorker'; unregister()
  • cloudflare https://www.cloudflare.com/a/caching/

, ( ) , .

0

, - , ,

{unregister} from ./registerServiceWorker

unregister();

create-response-app , gh-pages netlify.

0

Source: https://habr.com/ru/post/1685175/


All Articles