如何在ASP.net IIS 7.5上利用浏览器缓存

Mon*_*RPG 10 browser iis-7 caching lifetime browser-cache

以下可缓存资源的生命周期较短.为以下资源指定将来至少一周的到期日期:

http://pagespeed.googlelabs.com建议我将此作为我的网站的重中之重.我使用的是Windows Server 2008 r2 netframework 4.0 asp.net IIS 7.5.我该怎么做呢 ?

这是您可以看到的直接网址:http://pagespeed.googlelabs.com/#url=www.monstermmorpg.com&mobile=false&rule=LeverageBrowserCaching

Nik*_*tov 17

你可以从这篇文章开始,Mads Kristensen也写了一篇关于如何在你的网站上压缩,缩小和缓存动态和静态内容的有趣 博客文章.

<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>
Run Code Online (Sandbox Code Playgroud)

缓存静态内容

<staticContent>
 <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00"/>
</staticContent>
Run Code Online (Sandbox Code Playgroud)

  • 好的,我做了你的建议.我也从这里找到它http://www.iis.net/ConfigReference/system.webServer/staticContent/clientCache但是pagespeed谷歌仍然告诉我,我不利用浏览器缓存 (2认同)
  • `interesting`和`blog post`链接被打破了. (2认同)