[mod_python] Cache management in a mod_python environment

Joel Welling welling at psc.edu
Fri Sep 4 13:23:00 EDT 2009

Hi folks;
  I've written a web utility which generates images in mod_python, and
I'd like to keep recently generated images in a LRU cache.  I don't
understand the threading environment, however, and if many instances of
my app try to manage the cache simultaneously they'll get it wrong.
  If I run a mod_python page under apache, each httpd ends up creating
its own instance of the mod_python program, correct?  If a given httpd
services two requests at the same time, does a separate instance of the
module get created or does the function generating the page get run in
two different threads?  Is there any data structure I can attach cache
information to that will survive between requests within the same httpd?

-Joel Welling
 welling at psc.edu

More information about the Mod_python mailing list