Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 43244 invoked from network); 19 Mar 2009 20:26:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Mar 2009 20:26:49 -0000 Received: (qmail 13714 invoked by uid 500); 19 Mar 2009 20:26:48 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 13686 invoked by uid 500); 19 Mar 2009 20:26:48 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 13675 invoked by uid 99); 19 Mar 2009 20:26:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Mar 2009 13:26:48 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [65.42.26.132] (HELO Exfilt5admin.aoins.com) (65.42.26.132) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Mar 2009 20:26:39 +0000 X-WSS-ID: 0KGRSRG-01-12U-02 X-M-MSG: Received: from exfilt3.aoins.com (unknown [10.244.15.5]) by Exfilt5admin.aoins.com (Postfix) with ESMTP id 2D9AA1B9F4D3 for ; Thu, 19 Mar 2009 16:26:04 -0400 (EDT) Received: from [10.1.159.32] by exfilt3.aoins.com with SMTP (Auto-Owners Insurance SMTP Relay); Thu, 19 Mar 2009 16:27:07 -0400 X-Server-Uuid: 34606A75-2E8B-4752-8022-D7E209E7FFE6 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: rewrite before caching? Date: Thu, 19 Mar 2009 16:26:06 -0400 Message-ID: In-Reply-To: <40D5E3C3CBE03D45A776E7C358BDE908F2017F@missoula.formatdynamics.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: rewrite before caching? Thread-Index: Acmn97DewjV+UBq2Rt+FEHtznqKE9wA0Ps1wAAG4ARA= From: "Houser, Rick" To: modules-dev@httpd.apache.org X-WSS-ID: 65DC751126G565199-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Sounds like a badly broken application to me. If the data is truly cacheable, the application shouldn't be taking explicit steps to try to prevent just that. Depending on what the backend system is, you might be better off using some kind of a filter to just remove that killCache parameter in the body text before it gets to the client. Then, you don't have to worry about it at all. Thanks, Rick Houser Auto-Owners Insurance Systems Support (517)703-2580 -----Original Message----- From: Anthony J. Biacco [mailto:abiacco@formatdynamics.com]=20 Sent: Thursday, March 19, 2009 3:36 PM To: modules-dev@httpd.apache.org Subject: rewrite before caching? I posted this on the users list, but didn't get any help, so I'm hoping the dev people here can either help or at least explain if what I'm seeing below is how it's meant to work.. I have a uri with cachebusting in it that looks like this: /path?killCache=3Dx¶meter1=3Dy%parameter2=3Dz where x is a unix timestamp used to make sure the url isn't cached by the browser. Now though I want to use apache disk caching on this url. Obviously with the killCache parameters always changing though, this is futile. And I can't ignore the query string with CacheIgnoreQueryString because parameter1 and parameter2 are important to the output to the end-user, so the cache would be inconsistent if I had caching ignore the query string. So I decided to rewrite the url to remove the killCache parameter, and while this rule itself works fine (I'm rewriting to a path not a full url), it seems the cache check is done before the rewrite. My rule is: RewriteCond %{QUERY_STRING} ^killCache=3D(.+)\¶meter1=3D(.+)\¶meter2=3D(.+) RewriteRule ^/path /path?parameter1=3D%2¶meter2=3D%3 [L] And in the log I see: [Wed Mar 18 12:02:47 2009] [debug] mod_cache.c(131): Adding CACHE_SAVE filter for /path [Wed Mar 18 12:02:47 2009] [debug] mod_cache.c(138): Adding CACHE_REMOVE_URL filter for /path [Wed Mar 18 12:02:47 2009] [debug] mod_headers.c(740): headers: ap_headers_output_filter() mod_cache.c(639): cache: Caching url: /path?killCache=3Dx¶meter1=3Dy¶meter2=3Dz [Wed Mar 18 12:02:47 2009] [debug] mod_cache.c(645): cache: Removing CACHE_REMOVE_URL filter.=20 [Wed Mar 18 12:02:47 2009] [debug] mod_disk_cache.c(962): disk_cache: Stored headers for URL http://myhost/path?killCache=3Dx¶meter1=3Dy¶meter2=3Dz [Wed Mar 18 12:02:47 2009] [debug] mod_disk_cache.c(1051): disk_cache: Body for URL = http://myhost/path?killCache=3Dx¶meter1=3Dy¶meter2=3Dz cached. And I get a different cache file stored for every value of the parameter killCache. Anybody know a way to get the rewriterule processed before the cache mechanism? I can rewrite to a full url and the new request will then pull from cache, but that induces an extra request and an extra log entry, which I'd like to avoid if at all possible. Thanx, -Tony --------------------------- Manager, IT Operations Format Dynamics, Inc. 303-573-1800x27 abiacco@formatdynamics.com http://www.formatdynamics.com