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.

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

1 Answer 1

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

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.