Leverage browser caching with web.config in .net?

十年热恋 提交于 2019-12-04 02:19:35

Here is how I did on my site that is on a shared host. I believe the cacheControlMaxAge is as follows days:hours:minutes:seconds but dont quote me.

<system.webServer>  
    <staticContent>
        <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="3.00:00:00" />
    </staticContent>
</system.webServer>

Google PageSpeed Tools will improve rating by providing cacheControlMaxAge in your web.config file but if you want to solve issue completly then use 7 day (represented as days:hours:minutes:seconds) for catch max age

here is code to solve it put this code in to your web.config

<system.webServer>
 <staticContent>
  <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.24:00:00" />

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