httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rowan Collins <rowan.coll...@gmail.com>
Subject RFE: Control of HTTP cache control headers within mod_rewrite rules
Date Sun, 23 Oct 2011 17:54:42 GMT
Hello all,

Recent versions of Firefox, IE, and Chrome will now cache HTTP 301 and
302 responses based on the cache control headers, (roughly) in line
with the HTTP spec. This is, in general, a good thing, but can cause
some issues, as I've discussed here: http://rwec.co.uk/q/cached-redirs

When using mod_rewrite to produce such responses, there is no way of
influencing the cache control headers, so browsers will fall back to
their default behaviour by redirect type. (You could probably do
something clever with mod_expires or mod_headers, but getting it to
apply only to the relevant redirect would be tricky to say the least.)

As a minimum, it would be nice to be able to specify a cache life
time; in English: "send a 302, allow browser to cache for a week"; or
"send a 301, but limit browser to cache for 1 month". This could be a
new RewriteRule flag, using syntax similar to mod_expires, e.g.

RewriteRule /example http://example.com [R=302,CL=604800]
RewriteRule /example2 http://example.com
[redirect=permanent,cachelifetime="1 month"]

A more advanced version would be to allow custom HTTP headers using an
[HH=Foo:Bar] syntax or similar, but this may be going a bit far.

Does anyone have any thoughts? Is there somewhere I could file this
that a friendly developer might pick up?

Regards,
--
Rowan Collins
[IMSoP]

Mime
View raw message