I thought I was having an issue with my javascript being cached and not updated even with an updated version tag, like:
<script type="text/javascript" src="lib/myScript.min.js?v=3"></script>
But I realized that the problem is with my html file is being cached... so the browser doesn't even know there is a new script file.
I don't want to disable caching, but isn't there a way to let the browser know it doesn't have the most up-to-date html file? (And is this something I'd put in my html file, or on my apache2 server?)
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
Answer from Using tags to turn off caching in all browsers?
You can try these meta tags.I think it will solve your problem.
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With