You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Luc Levesque <lu...@travelpod.com> on 2005/11/24 00:15:41 UTC

[users@httpd] mod_cache & mod_rewrite

Hello,

    Let me start off by apologizing if this list doesn't handle questions 
like this but I hoped it might seeing as it's about standard Apache modules.

    We currently run mod_rewrite successfully on this URL:

/travel/United%20States/t.html
rewrites to:
/c/search2.pl?country=United%20States

    We would like to use mod_cache to cache this page, this works fine when
I target the search2.pl URL, but when using the alias ( ie: /travel ) it
always seems to not find the previously cached file. I am assume this is
because it uses the rewritten URL to determine if it should be cached and to
key the cache, then uses the original URL ( ie: /travel ) to see if the
cached object already exists, which it doesn't.

Here is what the logs show on every request to 
/travel/United%20States/t.html

[Wed Nov 23 12:06:49 2005] [debug] mod_cache.c(114): incoming request is
asking for a uncached version of /travel/United%20States/t.html, but we know
better and are ignoring it
[Wed Nov 23 12:06:51 2005] [info] disk_cache: Storing URL
127.0.0.1/c/search2.pl?country=United States
[Wed Nov 23 12:06:51 2005] [debug] mod_cache.c(613): cache: Caching url:
/travel/United%20States/t.html
[Wed Nov 23 12:06:51 2005] [debug] mod_cache.c(655): cache: Added date
header
[Wed Nov 23 12:06:51 2005] [debug] mod_disk_cache.c(613): disk_cache: Stored
headers for URL 127.0.0.1/c/search2.pl?country=United States
[Wed Nov 23 12:06:54 2005] [debug] mod_disk_cache.c(684): disk_cache: Body
for URL 127.0.0.1/c/search2.pl?country=United States cached.

As you can see it caches the search2 URL, not the /travel one... As I hit 
refresh, it alway prints the above.

If I access the URL at search2.pl ( ie: not using the rewrite ) it works 
just fine ( ie: it caches in the first request and pulls from cache the 
second time.

Can someone help? Can mod_cache be used on a rewritten URL?

Thanks!

Luc


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_cache & mod_rewrite

Posted by Joshua Slive <js...@gmail.com>.
On 11/23/05, Luc Levesque <lu...@travelpod.com> wrote:
> Hello,
>
>     Let me start off by apologizing if this list doesn't handle questions
> like this but I hoped it might seeing as it's about standard Apache modules.
>
>     We currently run mod_rewrite successfully on this URL:
>
> /travel/United%20States/t.html
> rewrites to:
> /c/search2.pl?country=United%20States
>
>     We would like to use mod_cache to cache this page, this works fine when
> I target the search2.pl URL, but when using the alias ( ie: /travel ) it
> always seems to not find the previously cached file. I am assume this is
> because it uses the rewritten URL to determine if it should be cached and to
> key the cache, then uses the original URL ( ie: /travel ) to see if the
> cached object already exists, which it doesn't.

I've never tried this type of setup myself, but I'll give you my
standard mod_cache response, which is that you should try running the
latest 2.1 beta.  Many improvements have been made in 2.1, and I know
the subrequest caching issue has been something on the table.  (But I
don't know if this particular issue is any different.)

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org