简体   繁体   English

Cache-Control标头的HTML元标记不适用于chrome

[英]HTML meta tag for Cache-Control header does not work with chrome

When opening my page I can see the cache-control header is set the right way. 打开页面时,我可以看到缓存控制标头设置正确。 I look into the Network tab and check the Response . 我查看“ 网络”选项卡,然后检查“ 响应” It says 它说

<meta http-equiv="Cache-Control" content="no-cache"/>

Now looking into the Header tab I can not find this header in the Response Header section. 现在查看“ 标题”选项卡,在“ 响应标题”部分中找不到该标题。 Also other headers set by the meta tag like <meta http-equiv="X-UA-Compatible" content="IE=edge"/> are not listed here: 此外,此处未列出由meta标签设置的其他标头,例如<meta http-equiv="X-UA-Compatible" content="IE=edge"/>

在此处输入图片说明

I read this Is Chrome ignoring Cache-Control: max-age? 我读过这篇文章Chrome是否忽略Cache-Control:max-age? which mentions that you should open the url in a new tab but I tried that and many other things. 其中提到您应该在新标签页中打开网址,但是我尝试了该操作以及许多其他操作。 Still no look for this headers to be visible. 仍然没有看到此标头可见。

Any idea what is wrong here? 知道这里有什么问题吗?

The header tab show the HTTP headers, not the meta http-equivs in HTML head. 标头标签显示HTTP标头,而不显示HTML标头中的meta http-equivs。

You have to set this HTTP header in your webserver configuration or from within your programming in order to see it in the Response Header section 您必须在网络服务器配置中或在编程中设置此HTTP标头,才能在“响应标头”部分中看到它

If you want to check, if your Cache-Control setting is working, don't just reload the page in your browser, but click in the address box and hit enter with the network tab in developer tools open and check the response code. 如果要检查Cache-Control设置是否正常工作,请不要只是在浏览器中重新加载页面,而要在地址栏中单击并在开发人员工具打开的网络标签中按Enter,然后检查响应代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM