What is Caching my DB

Ivan Voras ivoras at __yahoo__.com_
Mon Mar 27 15:15:29 EST 2006

Siah wrote:
> I just launched my django site for a client.  My problem is something
> is caching my db data in a bizzar way.  Here are some of the behaviours
> I get:
> - I login, and every other page it makes me login again for a 5 minutes
> or so and then it remembers that I am logged in.
> - I add a record, it reflects it to the site in close to 5 minutes from
> now
> - Every other DB related change takes some time to reflect

Some general points/ideas:

- AFAIK mysql can be setup to do SQL query cache, so maybe it's 
returning stale data somewhere
- If the web server is actually a cluster (e.g. multiple web servers 
under one DNS address) then it may be misconfigured not to share session 
data (I know this happens on SourceForge.net with PHP).
- Apache can also be set up to cache HTML (for example, if used as a proxy).
- Your browser may be caching HTML also, if you don't send Cache-control 
and Pragma headers.

I'm not familiar with django, so these points may or may not be 
applicable :)

More information about the Python-list mailing list