如何在所有浏览器中控制网页缓存?
我有一个网站启动并运行;我一直在努力改进网站。但是,除非Codumer Presse 清除缓存它不会更新到我的CSS和HTML的最新版本。我想更改使用
HTML的
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
HTTP高速缓存标头,因此网站始终拥有所有当前信息。
但是我不知道将此代码放在哪里。我创建一个名为html的新文件,还是我只是在index.html的某个地方输入此文件。请帮忙。
I have a website up and running; I am constantly working on improving the site. But unless the costumer presse clears the cache it does not update to the latest version of my css and html. I wanted to change the http cache header to be
USING HTML
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
So this way the website has all the current info at all time.
But I have no idea as to where to put this code in. Do I create a new file named html or do I just input this somewhere in my index.html. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将META标签放入HTML文件的Head标签中,但是如果HTTP响应中存在标头,则比优先级优先于Meta标签。如果您使用的是Apache,则创建.htaccess文件并将标题设置在此处以防止缓存
You can put meta tag inside the head tag of your html file but if header is present in http response than that takes priority over meta tag. If you are using apache then create .htaccess file and set header there to prevent caching