Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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!

share|improve this answer
    
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 '09 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 '09 at 11:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.