How to Version dist files to avoid browser cache?

How to avoid browser cache files in a Ionic 3 application? Every time I deploy a new version, I need to clear browser cache or open in anonymous window…

In angular I use to use the plugin gulp-useref to add a ?v=x.x.x, forcing the browser to download the updated file…

So, how to do it in Ionic 3? Is there another way to do it?

will this work?

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

But this way, all content will not be cached, right?
Would be better if the browser could cache the files, but update the files when a new version is deployed…

Hi,

did you allready find a solution?

I think it should be something like File-Fingerprinting or use of ETag (but this needs extra server-roundtrip) controlled by some version-variable.

Does anybody know of a working solution for this?

thanks
marc

See:

1 Like

thanks, will have a look at this!

Hi! Did you find a solution? I have the same question. Thanks!

Many thanks, Useful Guides

Did u get any solution ? I have same problem!!