Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use Apache 2.2 with mod_proxy to some 3rd party HTTP server.

As it doesn't send any Cache-Control header, I want to add one of 1 day for response code 200, 5 min for 404 and 0 for any other response code.

So I would something like :

SetEnvIf HttpResponseCode "200" rc_200
SetEnvIf HttpResponseCode "404" rc_404

Header set "Cache-Control" "private, max-age=0"
Header set "Cache-Control" "public, max-age=86400" env=rc_404
Header set "Cache-Control" "public, max-age=86400" env=rc_200
share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.