Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3575C947E for ; Sun, 23 Oct 2011 17:55:13 +0000 (UTC) Received: (qmail 42771 invoked by uid 500); 23 Oct 2011 17:55:12 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 42709 invoked by uid 500); 23 Oct 2011 17:55:11 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 42701 invoked by uid 99); 23 Oct 2011 17:55:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2011 17:55:11 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rowan.collins@gmail.com designates 209.85.161.173 as permitted sender) Received: from [209.85.161.173] (HELO mail-gx0-f173.google.com) (209.85.161.173) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 23 Oct 2011 17:55:04 +0000 Received: by ggnr5 with SMTP id r5so6561704ggn.18 for ; Sun, 23 Oct 2011 10:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=a93RAj+LrZUdwIuFFVTkJMTWx0QqjoF6OdUOtw4BaEg=; b=ujJunRx0cZEtey6pHny7TBc/U31fMMH9BcLa3I3yxeMEXj2FqpKyKBwWl4mRkhKIsm SN2jC8u/4yhExZGro/fq63hwiNyRXvQDvOfXBOehXULXAkO1bEOdV+TJzIs5pTMNvgK3 xAQ7nckajBmg7e57CLiq+Z7NL/b6lT2cGlREM= MIME-Version: 1.0 Received: by 10.101.24.2 with SMTP id b2mr286461anj.77.1319392482997; Sun, 23 Oct 2011 10:54:42 -0700 (PDT) Received: by 10.100.201.5 with HTTP; Sun, 23 Oct 2011 10:54:42 -0700 (PDT) Date: Sun, 23 Oct 2011 18:54:42 +0100 Message-ID: Subject: RFE: Control of HTTP cache control headers within mod_rewrite rules From: Rowan Collins To: dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 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]