Did you know: Enable content expiration in IIS 7 / 7.5

by vivek 12/13/2009 10:18:43 PM

When you want Web site content to expire automatically such that no obsolete information is cached at the proxy or Web browsers you configure Content expiration in IIS at the Web site level.

In IIS 6.0

  1. Right click on Web Site (Default Web Site in our case) and click on Properties
  2. Under HTTP Headers tab you can check Enable content expiration

     image7

In IIS 7 / 7.5

  1. Click on the Web Site (Default Web Site in our case)
  2. In the Features View, double click HTTP Response Headers
  3. Click on Set Common Headers… in Actions panel
    or Right click in the HTTP Response Headers Feature Page and click Set Common Headers…
  4. You can check Expire Web content: to enable content expiration

    image8 

NOTE: In IIS_schema.xml, under system.webServer/staticContent under clientCache

Example:

I have enabled Expire Web content and set it to Immediately. You will see the following in the webServer setting in the web.config of the Web site.

<configuration>
    <system.webServer>
        <staticContent>
            <clientCache cacheControlMode="DisableCache" />
        </staticContent>
    </system.webServer>
</configuration>

Hope this helps,
Vivek Kumbhar


Quote of the day:
Consistency requires you to be as ignorant today as you were a year ago. - Bernard Berenson


blog comments powered by Disqus

Rahul Soni

Rahul Soni  Twitter

 LinkedIn

 Facebook

 Email me



Vivek Kumbhar

Vivek Kumbhar  Twitter

 LinkedIn

 Facebook

 Email me


Stack Exchange

profile for Vivek at Server Fault, Q&A for system administrators and IT professionals

profile for Rahul Soni at Stack Overflow, Q&A for professional and enthusiast programmers

Calendar

<<  May 2013  >>
MoTuWeThFrSaSu
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

View posts in large calendar

All Items
Sign in

Visit Microsoft's Site

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2013, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0