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

Tags: , , , ,

Did you know | IIS 7

blog comments powered by Disqus

Disclaimer

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