Public bug reported:

Binary package hint: apache2

We ran into problems trying to cache a PHP site: every page other than /
was cached, but / (as in http://example.com/) wasn't being cached.

AFAICT, this is because / is being rewritten internally to 
'cgi-bin/php5/index.php'.  If I fetch that URL directly it's cached fine.
Also, if I put a(n apache) proxy in front of the PHP site and cache on the 
proxy side, it just works - presumably because the rewriting is hidden from the 
cache.

Before I figured out the proxy trick I was getting pretty desperate so I
started adding a bunch of printf-debugs to mod cache and apache to try
and figure out what was going on.  (The rest of this report is
speculation based on that so it may or may not be useful as I was really
messing around blindfolded here...)

Anyway, what I noticed was this:

[Fri Feb 23 16:57:38 2007] [error] add_any_filter_handle: cache_save
[Fri Feb 23 16:57:38 2007] [debug] mod_cache.c(142): Adding CACHE_REMOVE_URL 
filter for /

So we've added a cache_save and cache_remove_url filter to the output
filters.  And at this point, r->uri (the URI stored in the 'request') is
still /.  But then,

[Fri Feb 23 16:57:38 2007] [debug] mod_cache.c(881): /cgi-
bin/php5/index.php: cache_remove_url_filter() entry point

We invoke cache_remove_url_filter(), but at this point r->uri has
changed to the rewritten/internal URI.  And the cache_save filter is
never invoked - I didn't get far enough in my debugging to work out why
though.

** Affects: apache2 (Ubuntu)
     Importance: Undecided
         Status: Unconfirmed

-- 
mod cache doesn't cache due to internal redirects
https://launchpad.net/bugs/87373

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to