invalid以下资源是chrome审计中显式不可缓存的消息

时间:2016-01-06 17:04:07

标签: asp.net google-chrome asp.net-mvc-4 mono browser-cache

ASP.NET MONO MVC4应用程序在带有mod_mono的apache中运行 页面应仅缓存在浏览器或代理服务器中以节省服务器内存。

浏览器使用标题

从服务器获取产品列表
Request URL:http://example.com/store/Store/Category/ANDRORI?root=1&open=True&total=2.76
Request Method:GET
Status Code:200 OK
Remote Address:1.2.3.4:80

服务器返回带有标题的产品列表页面:

HTTP/1.1 200 OK
Date: Wed, 06 Jan 2016 16:52:47 GMT
Server: Apache/2.2.22 (Debian)
X-AspNet-Version: 4.0.30319
Cache-Control: private
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 8668
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8

Chrome开发者工具页面审核写了关于此页面的警告

The following resources are explicitly non-cacheable. Consider making them cacheable if possible:

每次都阅读此页面。响应包含

Cache-Control: private

所以页面必须我在浏览器中缓存。 如何解决这个问题,以便页面可以缓存在客户端?

我尝试添加控制器

[OutputCache(Location = System.Web.UI.OutputCacheLocation.Client, Duration = 20 * 60)]

但在这种情况下,页面将缓存在服务器中,并忽略查询字符串参数。 对于所有查询字符串参数,从服务器发送相同的页面。

0 个答案:

没有答案
相关问题