Browser Caching in ASP.NET application

后端 未结 6 2019
暖寄归人
暖寄归人 2020-12-14 21:43

Any suggestions on how to do browser caching within a asp.net application. I\'ve found some different methods online but wasn\'t sure what would be the best. Specifically, I

6条回答
  •  执念已碎
    2020-12-14 21:57

    You best bet to do this is to set an Expires header in IIS on the folders you want the content cached. This will tell most modern browsers and proxies to cache this static content. In IIS 6:

    1. Right click on the folder (example CSS or JS) you want to be cached by the browser.
    2. Click properties
    3. Go to the HTTP Headers Tab
    4. Check "Enabled content expiration"
    5. Set some long period for expiration, like "Expires after 90 days"

    Yahoo Developer's Blog talks about this technique.

提交回复
热议问题