You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2005/05/23 08:58:26 UTC

DO NOT REPLY [Bug 35016] New: - mod_cache doesn't cache after mod_rewrite manipulate URL

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35016>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35016

           Summary: mod_cache doesn't cache after mod_rewrite manipulate URL
           Product: Apache httpd-2.0
           Version: 2.0.54
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_cache
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: apache@dimedis.de


For searchengine optimization and to make our dynamic links a little bit nicer
we use a mod_rewrite map program, which rewrites a URL like this:

http://whiskey/cipp/cachetest,foo,1  ->  
lynx http://whiskey/cgi-bin/cachetest.cgi?foo=1

The RewriteRule looks like this:
  RewriteEngine On
  RewriteMap    stat2cgi           prg:/usr/local/bin/rewritemap_stat2cgi.pl
  RewriteRule   ^/cipp/(.+)$            ${stat2cgi:/cgi-bin/$1} [PT,L]


After years of using Apache 1.3 with a reverse acceleration squid proxy, we now
want to use mod_cache with Apache 2.0 for caching our dynamic content...

When requesting 
lynx http://whiskey/cgi-bin/cachetest.cgi?foo=1
everything works fine. The content was stored in the cache. 

When requesting
http://whiskey/cipp/cachetest,foo,1
the content was NOT stored in the cache...

Here are some interesting excerpts from the mod_rewrite log and mod_cache log:

mod_rewrite:
194.8.212.148 - - [23/May/2005:08:37:35 +0200]
[whiskey/sid#81550d8][rid#8396ea0/initial] (2) init rewrite engine with
requested uri /cipp/cachetest,foo,1
[whiskey/sid#81550d8][rid#8396ea0/initial] (3) applying pattern '^/cipp/(.+)$'
to uri '/cipp/cachetest,foo,1'
[whiskey/sid#81550d8][rid#8396ea0/initial] (2) rewrite /cipp/cachetest,foo,1 ->
/cgi-bin/cachetest.cgi?foo=1
[whiskey/sid#81550d8][rid#8396ea0/initial] (3) split
uri=/cgi-bin/cachetest.cgi?foo=1 -> uri=/cgi-bin/cachetest.cgi, args=foo=1

Here is the apache debug log:
[Mon May 23 08:52:18 2005] [debug] mod_cache.c(534): cache: Caching url:
/cipp/cachetest,foo,1
[Mon May 23 08:52:18 2005] [debug] mod_disk_cache.c(645): disk_cache: Stored
headers for URL whiskey/cgi-bin/cachetest.cgi?foo=1
[Mon May 23 08:52:18 2005] [debug] mod_disk_cache.c(747): disk_cache: Body for
URL whiskey/cgi-bin/cachetest.cgi?foo=1 cached.
[Mon May 23 08:52:18 2005] [debug] 

So it looks like mod_cache doesn't use the requesting URL but instead the
rewrited URL as the cache key.

In my opinion, this is a bug.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org