最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

html - The target should not be cached or have a 'cache-control' header with 'max-age=180' or le

programmeradmin2浏览0评论

I have been using MS Edge to work through some of the issues with a new website I am working on.

I am down to the last warning that Edge complains about, which is stated in the title of this question.

It shows the site url: mySubdomain.domain and this warning "Cache-Control: max-age=31536000".

I have looked at many sites that are referenced in search results and AI recommendations, but I have no idea how to fix this warning.

Any ideas?

Thanks...

BTW, I tried the following in the site index.html file:

<meta http-equiv="Cache-Control" content="max-age=100">
<meta http-equiv="Cache-control" content="no-cache">

Neither worked.


I found the following on a Google AI result, which I used for the affected site.

To prevent a website homepage from being cached by IIS, navigate to the site in IIS Manager, open "Output Caching", and then either uncheck "Enable Cache" and "Enable Kernel Cache" under Edit Feature Settings, or add a specific rule for the homepage extension (like ".html") and select "Prevent all caching" to explicitly disable caching for that file type.

Unfortunately this did not work on my development/remote servers.


I also tried setting development/remote IIS server caching through the GUI as follows:

<caching>
  <profiles>
    <add extension=".html" policy="DisableCache" kernelCachePolicy="DisableCache" />
  </profiles>
</caching>

This also failed to work.

Visual Studio complained that "DisableCache" is invalid, which is odd since IIS generated this code.

Lastly, this site behaves differently from my other sites, which do not cache the load page. I have to manually refresh the page in browsers, which is unacceptable.

Could really use some help on this issue.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论