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

Quick Tip - Clear ReSharper's Cache to Fix False Errors
Quick Tip - Refined GitHub
Vertical Layout for HTML Tables
Visual Studio 2017 Installer Quick Tip
VSColorOutput for VS 2017 Released
Quick ReSharper tip for inline templates
NoSQL vs. NewSQL: What's the Difference?
More... (1077)

Donate with PayPal