每次从服务器加载index.html,而不是从缓存中加载 [英] Load index.html every time from the server and NOT from cache
问题描述
我有一个托管在特定服务器上的网页 index.html 。我已将 example.com
指向 example.com/index.html
。因此,当我在index.html中进行更改并保存它,然后尝试打开example.com时,更改不会反映出来。
PS:我知道诡计的CSS,JS和图像文件,即附加?v = 1
但不知道如何做index.html。
任何帮助将不胜感激。谢谢!
by this:
< meta http-equiv =expirescontent =0>
将内容设置为0会告诉浏览器始终从Web服务器加载页面。
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!
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.
这篇关于每次从服务器加载index.html,而不是从缓存中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!