Load index.html every time from the server and NOT from cache

Pulkit Mittal picture Pulkit Mittal · Nov 10, 2012 · Viewed 39.8k times · Source

I have a webpage index.html hosted on a particular server. I have pointed example.com to example.com/index.html. So when I make changes in index.html and save it, and then try to open example.com, the changes are not reflected. Reason that the webpages are being cached.

Then I manually refresh the page and since it loads the fresh copies and not from cache, it works fine. But I cannot ask my client to do so, and they want everything to be perfect. So my question is that is there a trick or technique as to how I can make the file load every time from the server and not from cache?

P.S: I know the trick for CSS, JS and images files, i.e. appending ?v=1 but don't know how to do it for index.html.

Any help would be appreciated. Thanks!

Answer

doniyor picture doniyor · Nov 10, 2012

by this:

<meta http-equiv="expires" content="0">

Setting the content to "0" tells the browsers to always load the page from the web server.