httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damon Green <damon...@gmail.com>
Subject Re: mod_cache not caching 301s
Date Thu, 12 May 2011 11:22:10 GMT
Does anyone have any ideas on this? According to the docs It is supposed to
work.

Thanks,
Damon.


On Wed, May 11, 2011 at 9:49 AM, Damon Green <damon.ft@gmail.com> wrote:

> Hi Folks, I posted this question on users but haven't had any joy there,
> hoping someone here may know more.
>
> I have an issue with mod_cache, it refuses to cache redirects (301) and
> insists on cacheing 404 error responses, so really two issues.
>
> I'm using Apache 2.2.17 and the mod_cache/mod_disk_cache from Apache 2.3
> which serves stale content from its disk cache when the Tomcat is
> unavailable. (patched version from Graham Leggett)
>
> Trawling the list archives and docos imply that 404 responses should not be
> cached, and that 30x responses should be, but the behaviour I'm seeing is
> the opposite of that.
>
> I need 301 redirects to remain working (from the cache) when we disable
> Tomcat.
>
> To test this Ive created a rewrite rule in the Apache conf:
>
> RewriteRule ^/damon/(.*)    http://www.slashdot.org [R=301,L]
>
> Then cleared the cache, hit a page in /damon/, got redirected, nothing
> created in the disk cache.
> any 200 or 404 however creates files in the cache.
>
>
>
> http://httpd.apache.org/docs/2.2/caching.html
>
> # The response must have a HTTP status code of 200, 203, 300, 301 or 410.
>
> This is largely a function 13.4 in the RFC:
>
>    A response received with a status code of 200, 203, 206, 300, 301 or
>    410 MAY be stored by a cache and used in reply to a subsequent
>    request, subject to the expiration mechanism, unless a cache-control
>    directive prohibits caching. However, a cache that does not support
>    the Range and Content-Range headers MUST NOT cache 206 (Partial
>    Content) responses.
>
>
> Any advice or ideas gratefully received.
>
> Regards,
> Damon Green.
>
>

Mime
View raw message