Sunday, January 23, 2011

IIS6/7 Doesn't enable HTTP Response Headers for content expiration/caching by default?

I just realized that by default when you create a new site in IIS it defaults to not including any expiration headers. I had been assuming it would be enabled with something reasonable like a day or so. Is this truly the default? Is there anyway to change to a default policy that keeps expiration/caching enabled?

  • The default is indeed to not have content expiration enabled on the server. This doesn't mean that no expiration is happening though, just that the client will control content expiration.

    You can enable it for all sites/virtual directories by going to the setting at the "Web Sites level (in IIS6) or at the server level (in IIS7) - this will make the setting propagate down to all existing sites and be applied to any new site.

    This doesn't "keep the setting enabled" though - any site or virtual directory could potentially have its own custom setting for content expiration.

    Jerry Mayers : In my tests it appears that without content expiration enabled on the server FF, IE, Chrome all don't cache and request all resources every page load.
    From MattB

0 comments:

Post a Comment