1

Is there a <meta> header that I can add to not cache the index.html page itself but to allow caching for all other assets on that page (images/js/etc).

The reason I need to do this is because when I update my website with new javascript files that are named differently, sometimes when I bring up the updated site, the website tries to load the old files and I have to force refresh the page to update index.html.

(I'm sorry if this is answered before. After searching all stackoverflow posts seem to give great comments but to do not confirm or deny whether other assets on that page will be cached)

bryan
  • 8,879
  • 18
  • 83
  • 166
  • Have a look on this. https://theknowledgeadda.com/disable-caching-with-meta-html-tags-in-all-browser – Mehrwarz Feb 16 '22 at 14:10
  • @Mehrwarz this doesn't really give me a definitive answer. It just says "disable caching in browsers" – bryan Feb 16 '22 at 15:07
  • These are the tags: – Mehrwarz Feb 16 '22 at 15:57
  • And that will not cache the contents inside the html file? javascript/images/css? @Mehrwarz – bryan Feb 16 '22 at 15:59
  • what is the platform you use? are using Apache and PHP or some thing else? If your using php you can disable the catch with ini_set("opcache.enable","0") in index.php and on other pages ini_set("opcache.enable","1") ; – Mehrwarz Feb 16 '22 at 21:45
  • Does this answer your question? [How do we control web page caching, across all browsers?](https://stackoverflow.com/questions/49547/how-do-we-control-web-page-caching-across-all-browsers) – Joe Feb 17 '22 at 23:14

0 Answers0