Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc IIS7+ASP.NET MVC客户端缓存头不工作_Asp.net Mvc_Caching_Iis 7 - Fatal编程技术网

Asp.net mvc IIS7+ASP.NET MVC客户端缓存头不工作

Asp.net mvc IIS7+ASP.NET MVC客户端缓存头不工作,asp.net-mvc,caching,iis-7,Asp.net Mvc,Caching,Iis 7,我已经在IIS7和Windows Server 2008上部署了一个ASP.NET MVC应用程序 我在这里和网上都读过文章,但无法让该死的客户端缓存正常工作 我正在尝试缓存/Content文件夹中的所有内容。到目前为止,我已经在IIS管理器中选择了该文件夹,并在Common Header下设置了相应的HTTP响应头。我还检查了/Content文件夹中的web.config文件,其中的值正在设置中 FireBug返回/Content中的所有资源: Cache-Control no-cache

我已经在IIS7和Windows Server 2008上部署了一个ASP.NET MVC应用程序

我在这里和网上都读过文章,但无法让该死的客户端缓存正常工作

我正在尝试缓存/Content文件夹中的所有内容。到目前为止,我已经在IIS管理器中选择了该文件夹,并在Common Header下设置了相应的HTTP响应头。我还检查了/Content文件夹中的web.config文件,其中的值正在设置中

FireBug返回/Content中的所有资源:

Cache-Control   no-cache, no-store, must-revalidate
Pragma        no-cache
Content-Type    image/png
Expires      -1
Last-Modified   Sun, 11 Oct 2009 19:01:40 GMT
Accept-Ranges   bytes
Etag            "f318d643a54aca1:0"
Server        Microsoft-IIS/7.0
X-Powered-By    ASP.NET
Date            Sun, 11 Oct 2009 20:40:01 GMT
Content-Length  620  
请注意正在请求的此静态映像的缓存控制和过期值

该网站目前正在调试中编译,这将改变,但肯定不会有什么不同

很明显,我忽略了一些东西,任何想法都会被感激的


谢谢

如果您无法使用IIS管理工具使其正常工作,请尝试来自的Jeff Atwood的建议 :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
    </staticContent>
  </system.webServer>
</configuration>