0

I Upgrade my react app and when I want to release it, clients can't see my changes until they do a hard refresh (Ctrl+F5).

How can I upgrade it without need to hard refresh by clients?

Pritesh
  • 1,066
  • 3
  • 15
  • 35
  • 3
    If you're using webpack you could hash your bundle filename: https://webpack.js.org/guides/caching/ – Dacre Denny Aug 26 '19 at 04:47
  • [HMR](https://webpack.js.org/concepts/hot-module-replacement/) might lead to an interesting solution. I have never seen anyone doing this in production. [This SO answer](https://stackoverflow.com/questions/24581873/what-exactly-is-hot-module-replacement-in-webpack/24587740#24587740) also explains well. – Suman Kundu Aug 26 '19 at 05:18

1 Answers1

1

If you don't use webpack or systemjs, you can pull version number at the end of the file url

<script type="text/javascript" src="app.js?20190826"></script>
kamprasad
  • 608
  • 4
  • 12