微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何利用ASP.net IIS 7.5中的浏览器缓存

以下可缓存资源具有短暂的生命周期.指定以下资源的至少一周的到期时间:

http://pagespeed.googlelabs.com建议我这个为我的网站作为高优先级.我正在使用windows server 2008 r2 netframework 4.0 asp.net IIS 7.5.我该怎么做?

这是你直接看到的URL:http://pagespeed.googlelabs.com/#url=www.monstermmorpg.com&mobile=false&rule=LeverageBrowserCaching

解决方法

您可以从 this article开始,Mads Kristensen也写了一个 interesting blog post如何在您的网站上压缩,缩小和缓存动态和静态内容.
<configuration> 
 <location path="showStockPrice.asp">     
   <system.webserver>        
     <caching>         
       <profiles>
         <add varybyquerystring="*"location="Any"
           duration="00:00:01" policy="CacheForTimePeriod"            
           extension=".asp">
       </profiles>
     </caching>
   </system.webserver>
 </location>

缓存静态内容

<staticContent>
 <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00"/>
</staticContent>

原文地址:https://www.jb51.cc/aspnet/245953.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐