加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-15 20:21:24 所属栏目:asp.Net 来源:网络整理
导读:以下可缓存资源具有短暂的生命周期.指定以下资源的至少一周的到期时间: http://pagespeed.googlelabs.com建议我这个为我的网站作为高优先级.我正在使用windows server 2008 r2 netframework 4.0 asp.net IIS 7.5.我该怎么做? 这是你直接看到的URL:http://
以下可缓存资源具有短暂的生命周期.指定以下资源的至少一周的到期时间:

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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读