How to prevent proxy servers from caching your content
A lot of people around the world are sitting behind proxy servers and it can be a good thing, because it reduces the bandwidth costs to a site. However, you don’t really have control over how the proxy server is setup, so you can’t really tell when it will refresh the content. To get around this, you can apply “Cache-Control: private” to the header of the request that is made. Doing so will tell the proxy server (shared cache) that it shouldn’t cache it.
Private - Indicates that all or part of the response message is intended for a single user and MUST NOT be cached by a shared cache. This allows an origin server to state that the specified parts of the response are intended for only one user and are not a valid response for requests by other users. A private (non-shared) cache MAY cache the response.
- RFC 2616
Weather or not to use this really depends on your site and what you are trying to achieve.
If you have a large, diverse audience, can afford higher bandwidth costs, and have a reputation for high quality, compress your content and use “Cache-Control: private”. This disables proxies but avoids edge case bugs.
- High Performance Web Sites, Steve Souders
If you can’t afford the bandwidth costs then you shouldn’t do it and furthermore there are no guarantees in life and this will only work if the proxy server honors “private”.