1

Just trying to do a bit of performance tuning on a client's site. I don't want to set far future expiries yet, because we are still changing a lot of stuff regularly, but I'd like to give everything an expiry time of one hour (which will avoid repeat requests for static content during most average visits to the site).

I'm returning Cache-Control headers with a value of max-age=3600, which is fine; however, do I need to set Expires headers too, or are they obsolete now? And if I do need to set them, how would I do it using IIS Manager? The site is served from IIS 6.

1 Answer 1

2

The Expires entity-header field gives the date/time after which the response is considered stale.

The Cache-Control general-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain.

The Expires header is a short form of 'Cache-Control: max-age=...', and is not obligatory to be obeyed. To ensure your rules work okay, use both of them: it will do no harm, really :)

Cheers!

2
  • Thanks - so how would I set dynamic Expires headers so that assets would expire 1 hour from when they were first downloaded?
    – Mark Bell
    Nov 27, 2009 at 9:25
  • 'Expires' header sets an exact date, while 'Cache-Control: max-age ' handles relative age of downloaded content. use the latter :)
    – kolypto
    Nov 27, 2009 at 11:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .