How to Leverage browser caching at ASP.net IIS 7.5

可紊 提交于 2019-12-04 08:34:05

问题


The following cacheable resources have a short freshness lifetime. Specify an expiry of at least one week in the future for the following resources:

http://pagespeed.googlelabs.com suggest me this for my website as a high priority. I am using windows server 2008 r2 netframework 4.0 asp.net IIS 7.5 . How do i do this ?

This is the direct url for you to see : http://pagespeed.googlelabs.com/#url=www.monstermmorpg.com&mobile=false&rule=LeverageBrowserCaching


回答1:


You might start here with this article, also Mads Kristensen had written an interesting blog post on how to compress, minify and cache dynamic and static content on your website.

<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>

To cache static content

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


来源:https://stackoverflow.com/questions/6634302/how-to-leverage-browser-caching-at-asp-net-iis-7-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!