Mike-Ward.Net

Set the Expires header on static content to increase web site performance

Yahoo and Google recommend setting the Expires header of a web site’s static content (i.e. images) to some distant future date. This makes those components cacheable. It also avoids unnecessary HTTP requests on subsequent page views. If you’re using IIS7, just add the following to your Web.config.

<system.webServer>  
  <staticContent>  
    <clientCache cacheControlMode="UseExpires"  
       httpExpires="Tue, 19 Jan 2038 03:14:07 GMT" />  
  <staticContent>  
<system.webServer>  

Just remember that if you change any of your static content, you’ll have to change the file name.

← newer older →
.Net, Technology, Life, Whatever

Recent Posts

Checklist Buddy Available for Testing
Tweetz 2.0.0 Released
Tweetz 2.0 Beta
VSColorOutput 2.7 - Time Stamps
Fixed Focal-Length Eyeglasses, a Programmer's Best Friend
How to Choose the Right VPN Service
Two Handy Command Line Scripts
More... (1089)

Donate