mod cache doesn't cache due to internal redirects

Bug #87373 reported by James Troup
6
Affects Status Importance Assigned to Milestone
Gimmix
Invalid
Undecided
Unassigned
apache2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

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.

Revision history for this message
priyank (priyankmg) wrote :

Isn't that supposed to be filed under apache's bugtracker ?

priyank (priyankmg)
Changed in gimmix:
status: Unconfirmed → Rejected
Revision history for this message
Paul Dufresne (paulduf) wrote :

No, this package come from Debian, and only the Debian package manager should took the decision to directly report upstream. Because Debian modify stuff so that the files may well not exist on Apache2 upŝtream.

Revision history for this message
Paul Dufresne (paulduf) wrote :

Thanks for your report.
Knowing version number would be great, but anyway I think there is enough info, so am confirming this bug.

Changed in apache2:
status: New → Confirmed
Revision history for this message
Mathias Gug (mathiaz) wrote :

Could you specify your rewrite setup ?

Could you also specify which version apache2 you're using ?

Changed in apache2:
status: Confirmed → Incomplete
Revision history for this message
wolfger (wolfger) wrote :

Over 5 months without a reply. We are closing the apache2(Ubuntu) bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in apache2:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.