On Thu, Feb 26, 2015 at 10:21 AM, Paul Beckett <[email protected]> wrote:
> Is there any way to restrict what HTTP response codes are cached by Apache,
> ideally I would like to only cache 200,301,302 responses.
It is not possible to specify some particular status mod_cache would
or not cache, it is solely controlled by the relevant Cache-Control
and Expires headers.
(Note that 301 will not be cached unless "forced" by these headers).
You could use some mod_headers rule(s) like :
Header merge Cache-Control private "expr=%{REQUEST_STATUS} == 404"
Header merge Pragma no-cache "expr=%{REQUEST_STATUS} == 404"
to prevent mod_cache (but also other caches down the chain) from
caching eg. 404s.
Regards,
Yann.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]