[Catalyst] Apache <-> DB-Problem

Florian Rossol rossol at yola.in-berlin.de
Sun Nov 6 12:34:13 CET 2005


On Sun, Nov 06, 2005 at 10:51:40AM +0000, Jules Bean wrote:
> Florian Rossol wrote:
> >When I edit the same entry in the table serveral times, after some
> >time in the view and edit-page appears randomly older versions of the
> >entry. At this time I checked the DB, but in the table in the DB the
> >entry was correct at the newest version, so there is no error during
> >writing the modified version to the DB.
> >  
> 
> It's not impossible this is an obscure bug, but most of the kinds of 
> bugs I can imagine would also show up with the test server. I'd 
> seriously consider the possibility that it could be a caching bug in 
> your user agent. 

I thought of this first too. I added 

---(snipp)---
sub begin : Global {
    my ($self, $c) = @_;
    $c->res->headers->header( 'Cache-Control' => 'max-age=0' );
}
---(snapp)---

to my main file (app/lib/app.pm). Every page is served with the
"Cache-Control: max-age=0"-header to prevent user agent caching.
It is definitely not a caching problem: When I call a edit-page with a
browser which I never used before (epiphany) it is also an older
version of the DB-Contents.

Restarting Apache solves the problem for some time (perhaps for 10
modifications).

> Check with a few different user agents and see if you 
> can replicate it in all of them; also as you are testing, have the 
> server log file open and be sure that your page views are generating 
> '200' requests. If you see no request at all, it's user agent caching. 
> If you see a 304 response code then some configuration on the server is 
> incorrectly telling the user-agent that it is permitted to serve the 
> previously cached version.

Apache is generating '200' request all the time.

I'm pretty sure that this has something to do with the
apache-childs. Is there any chance to find out, which child answered a
request. If this is possible I can associate the served version of the
page to a single child.

Thanks

Florian



More information about the Catalyst mailing list