ASP.NET MVC应用程序页面包含订单标题和订单行。 使用jquery,jqgrid,jqueru ui和一些jqueru ui插件。 所有js文件都编译为单个缩小文件default.js
从ASP.NET标准脚本,内容和主题子目录加载资源 在ASP .NET MVC应用程序树中。
在Chrome浏览器中运行审核会引发建议使静态资源可以缓存而不使用Cookie。
首次审核问题看起来Mono禁用了缓存控制。响应标头如下所示:
Cache-Control:private
Connection:Keep-Alive
Date:Sun, 07 Oct 2012 19:38:15 GMT
Keep-Alive:timeout=15, max=97
Server:Apache
对于第二个问题,它看起来像浏览器发送css文件和图像的cookie:
Connection:keep-alive
Cookie:ASP.NET_SessionId=8E6FF8F8BAE86246BF49C1C5; .MyAuth=fDmFg9sG5ZfQBCwcgOpdrgSH/OcY5+xVyL9XJko1SwObAZcMQbZyNYz4JZ7fTZLBNVhjw23LuKrBiYqM5G0lccXUxkK/S37rToQfmBR4JfmlVTBT; .MyRoles=
如何解决这些问题? 最好保留ASP.NET应用程序目录结构并提供来自应用程序子目录的所有文件
Chrome审核结果如下:
Leverage browser caching (16)
The following resources are explicitly non-cacheable. Consider making them cacheable if possible:
Detail
jquery-ui-1.8.12.custom.css
ui.jqgrid.css
Site.css
default.js
ui-bg_inset-hard_100_fcfdfd_1x100.png
ui-bg_flat_55_fbec88_40x100.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_gloss-wave_55_5c9ccc_500x100.png
DokG.png
ui-bg_inset-hard_100_f5f8f9_1x100.png
ui-bg_glass_85_dfeffc_1x400.png
ui-icons_6da8d5_256x240.png
ui-bg_flat_0_aaaaaa_40x100.png
ui-icons_d8e7f3_256x240.png
ui-icons_469bdd_256x240.png
Serve static content from a cookieless domain (14)
2.53KB of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:
jquery-ui-1.8.12.custom.css
ui.jqgrid.css
Site.css
ui-bg_inset-hard_100_fcfdfd_1x100.png
ui-bg_flat_55_fbec88_40x100.png
ui-bg_glass_95_fef1ec_1x400.png
ui-bg_gloss-wave_55_5c9ccc_500x100.png
DokG.png
ui-bg_inset-hard_100_f5f8f9_1x100.png
ui-bg_glass_85_dfeffc_1x400.png
ui-icons_6da8d5_256x240.png
ui-bg_flat_0_aaaaaa_40x100.png
ui-icons_d8e7f3_256x240.png
ui-icons_469bdd_256x240.png