I'm trying to get mod_cache to ignore the query_string part of the
request, since our customers use "clicktags" in references to static
banners. I need to cache these request to improve performance.

My idea was to "RewriteRule .* %{REQUEST_URI}?", however I have learned
that mod_cache is run as a "quick_handler". However the actual
cache_create_entity() call run _after_ the url being rewritten,
resulting in the behaviour below (some debug calls have been added to
mod_cache). One can see that create_select use the unrewritten request
"http://1.2.3.4:80/index.html?ref=x";, and create_select the rewritten
"http://1.2.3.4:80/index.html?";. This clearly makes mod_cache and
mod_rewrite incompatible.

[Thu Jan 18 18:40:06 2007] [debug] cache_storage.c(440): key generated:
http://1.2.3.4:80/index.html?ref=x
[Thu Jan 18 18:40:06 2007] [debug] cache_storage.c(198): cache_select
key: http://1.2.3.4:80/index.html?ref=x
[Thu Jan 18 18:40:06 2007] [debug] mod_cache.c(129): Adding CACHE_SAVE
filter for /index.html
[Thu Jan 18 18:40:06 2007] [debug] mod_cache.c(136): Adding
CACHE_REMOVE_URL filter for /index.html
[Thu Jan 18 18:40:06 2007] [debug] cache_storage.c(440): key generated:
http://1.2.3.4:80/index.html?
[Thu Jan 18 18:40:06 2007] [debug] cache_storage.c(80):
cache_create_entity key: http://1.2.3.4:80/index.html?
[Thu Jan 18 18:40:06 2007] [debug] mod_cache.c(609): cache: Caching url:
/index.html?ref=x
[Thu Jan 18 18:40:06 2007] [debug] mod_cache.c(615): cache: Removing
CACHE_REMOVE_URL filter.
[Thu Jan 18 18:40:06 2007] [debug] mod_cache.c(658): cache: Added date
header
[Thu Jan 18 18:40:06 2007] [debug] mod_disk_cache.c(954): disk_cache:
Stored headers for URL http://1.2.3.4:80/index.html?
[Thu Jan 18 18:40:06 2007] [debug] mod_disk_cache.c(1043): disk_cache:
Body for URL http://1.2.3.4:80/index.html? cached.

I understand this has been discussed earlier in the " mod_cache, don't
always run as a quick handler." discussion, and I'd like to second this
request. And/or I'd be very happy to add a "CacheIgnoreQueryString On"
option to mod_cache.

Kind regards,
Fredrik Widlund


Reply via email to