Reputation: 570
The main two ways to cache bust are:
I understand the reason and mechanisms behind this.
However what I do not understand is how to cache bust the index.html of a website, for example a SPA. The browser cache could keep the index.html of the SPA for a long time and thus the css/js files would never get cache busted.
Is the index.html handled as a special case by browsers or could the described behaviour happen?
Upvotes: 4
Views: 4763
Reputation: 364
Add to your HTML head:
<meta http-equiv="Cache-Control" content="max-age=0, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0" />
Upvotes: 6