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 have already enabled browser caching on my apache but there's another thing, audit report of chrome for my web page suggests "Leverage proxy caching (35)". Any idea how to do that?

share|improve this question

You only want to allow public proxies to do caching on resources that are public (accessible to the world, no authentication, etc) and static (the same content is delivered to all users). So you may want to limit this to just content where it makes sense, like JS, CSS, and image files.

That said, what you'll want to do is to set the Cache-Control header. Something like this, to allow a public proxy to keep the content an hour:

Header set Cache-Control "max-age=3600, public"

The Vary: Accept-Encoding is also important to make sure the public proxies don't break when your content is compressed, but mod_deflate should handle this for you if needed.

share|improve this answer
where should i set this header? – Gagan Deep Dec 1 '12 at 8:23
@GaganDeep If it's appropriate for everything in your server to be cached, then put it in your <VirtualHost> block. Otherwise, put it somewhere that applies only to resources that should be cached, something like <Location /static/> or <FilesMatch "\.(js|css|jpg)$"> – Shane Madden Dec 1 '12 at 19:46
Can this go in .htaccess? – brentonstrine Sep 23 '14 at 23:35

Your Answer


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.