Caching in memory for Apache

Adam DePrince adam.deprince at
Sat Mar 25 01:40:22 CET 2006

On Fri, 2006-03-24 at 06:56 -0800, Simon Johnson wrote:
> Dear All,
> I have decided to take the big plunge and drop the Microsoft platform
> and use Mod_Python and Apache in it's place.
> I've never used Linux before this project so it's a really big learning
> curve, but so far it's going well. I've managed to create some simple
> pages using the basic of Python.
> One of the questions I have is: How do you cache stuff in memory? Say
> I've got a bunch of stuff I need to create from a set of database rows.
> Obviously, I do not want to consult the database each time I have a

Why not hit the database each time?  That's what it is there for.  What
you are trying to do is called premature optimization.  

You are facing a huge learning curve.  My recommendation is to build it
first with close adherence to the KISS principal.  After its built, take
it for a spin.  If it is too slow, then tune it.   Think towards
implementation simplicity, not speed.  You will probably find that
whatever you build will be fast enough when you are finished.  

> request for my page. Is there anyway in Mod_python for me to store
> values inside memory so I can look it up on the next GET request?

Your database really is the best place for that.

Good luck - Adam DePrince

More information about the Python-list mailing list