Bug 51057 - mod_disk_cache does not cache URL ending in a trailing forward slash (when DirectoryIndex resource is used)
Summary: mod_disk_cache does not cache URL ending in a trailing forward slash (when Di...
Status: RESOLVED DUPLICATE of bug 45273
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_cache_disk / mod_disk_cache (show other bugs)
Version: 2.2.3
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-13 15:53 UTC by Geoff Millikan
Modified: 2011-04-13 20:41 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Millikan 2011-04-13 15:53:51 UTC
Dear DEV Guru's,

This URL is cached by mod_disk_cache (see debug logs below):
http://www.t1shopper.com/mod_disk_cache_bug/index.php

This isn't cached (see debug logs below):
http://www.t1shopper.com/mod_disk_cache_bug/

This also impacts query strings for example /mod_disk_cache_bug/index.php?monkey=happy would be cached but /mod_disk_cache_bug/?monkey=unhappy is not cached.

I guessing this bug is caused by the way mod_dir is internally handling the DirectoryIndex page (index.php or index.html, etc) - I suppose it's bypassing mod_cache. 

The documentation doesn't indicate this behavior is by design.  May I suggest we either call this out in the docs or fix it.

Thanks,

Geoff Millikan

---= Log showing page being written to host's cache =---
mod_cache.c(131): Adding CACHE_SAVE filter for /mod_disk_cache_bug/index.php
mod_cache.c(138): Adding CACHE_REMOVE_URL filter for /mod_disk_cache_bug/index.php
mod_deflate.c(602): Zlib: Compressed 19 to 21 : URL /mod_disk_cache_bug/index.php
mod_headers.c(663): headers: ap_headers_output_filter()
mod_cache.c(639): cache: Caching url: /mod_disk_cache_bug/index.php
mod_cache.c(645): cache: Removing CACHE_REMOVE_URL filter.
mod_disk_cache.c(962): disk_cache: Stored headers for URL http://www.t1shopper.com:80/mod_disk_cache_bug/index.php?
mod_disk_cache.c(1051): disk_cache: Body for URL http://www.t1shopper.com:80/mod_disk_cache_bug/index.php? cached.

---= Log showing page served from host cache to client =---
mod_disk_cache.c(476): disk_cache: Recalled cached URL info header http://www.t1shopper.com:80/mod_disk_cache_bug/index.php?
mod_disk_cache.c(749): disk_cache: Recalled headers for URL http://www.t1shopper.com:80/mod_disk_cache_bug/index.php?
mod_cache.c(282): cache: running CACHE_OUT filter
mod_cache.c(296): cache: serving /mod_disk_cache_bug/index.php


---= Log showing "forward slash page" not served to client =--- 
mod_cache.c(131): Adding CACHE_SAVE filter for /mod_disk_cache_bug/ 
mod_cache.c(138): Adding CACHE_REMOVE_URL filter for /mod_disk_cache_bug/ 
mod_deflate.c(602): Zlib: Compressed 19 to 21 : URL /mod_disk_cache_bug/index.php

---= Here's the config =---
LoadModule disk_cache_module modules/mod_disk_cache.so
CacheRoot /var/httpd/proxy/
CacheEnable disk /
CacheDisable /i
CacheMaxFileSize 500000
CacheMinFileSize 1
CacheDirLevels 4
CacheDirLength 2
CacheIgnoreCacheControl Off
CacheIgnoreNoLastMod Off 
CacheIgnoreHeaders Set-Cookie
CacheLastModifiedFactor 30
CacheMaxExpire 2592000
CacheDefaultExpire 2592000

---= Version =---
httpd-2.2.3-45.el5.centos.x86_64.rpm
Server built:   Jan 31 2011 17:50:30
Linux 2.6.18-238.5.1.el5 x86_64 x86_64
Comment 1 Geoff Millikan 2011-04-13 18:03:32 UTC
This ticket does a better job detailing the impact/symptoms but it is in fact a duplicate of Bug 45273.  Dang.
Comment 2 Geoff Millikan 2011-04-13 18:28:31 UTC
Per Bug 45273, it appears the issue is in mod_dir (DirectoryIndex) and the effects seen here in mod_cache/mod_disk_cache are symptomatic.  It appears real fix needs to be done as per Bug 45273 however I will leave this ticket open as placeholder unless more senior dev members have thoughts otherwise.
Comment 3 Eric Covener 2011-04-13 20:41:21 UTC

*** This bug has been marked as a duplicate of bug 45273 ***