squid FAQ
How come some objects do not get cached?
To determine whether a given object may be cached, Squid takes many things into consideration. The current algorithm (for Squid-2) goes something like this:
- Responses with Cache-Control: Private are NOT cachable.
- Responses with Cache-Control: No-Cache are NOT cachable.
- Responses with Cache-Control: No-Store are NOT cachable.
- Responses for requests with an Authorization header are cachable ONLY if the reponse includes Cache-Control: Public.
- The following HTTP status codes are cachable:
- o 200 OK o 203 Non-Authoritative Information o 300 Multiple Choices o 301 Moved Permanently o 410 Gone
However, if Squid receives one of these responses from a neighbor cache, it will NOT be cached if ALL of the Date, Last-Modified, and Expires reply headers are missing. This prevents such objects from bouncing back-and-forth between siblings forever.
A 302 Moved Temporarily response is cachable ONLY if the response also includes an Expires header.
The following HTTP status codes are "negatively cached" for a short amount of time (configurable):
- 204 No Content
- 305 Use Proxy
- 400 Bad Request
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 414 Request-URI Too Large
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Time-out