[mod_python] Sending a message to Apache children

Simon Willison cs1spw at bath.ac.uk
Mon Nov 10 15:16:30 EST 2003


Hi all,

Is there a way of sending a "message" to all Apache children running a 
mod_python application? Here's the problem: we have a template system 
which compiles template strings in to an in-memory data structure. This 
structure is cached in memory in a global dictionary for each Apache 
child. At the moment templates are stored in the cache with a timestamp 
saying when they were loaded, and expire and are reloaded every 5 
minutes. We want to be able to instantly invalidate a cached template if 
an urgent change needs to be made to the site.

Is there a way of pushing out a message to all of the Apache children 
saying "reload template X NOW", without having to hit the file system or 
database for every template request?

Cheers,

Simon Willison



More information about the Mod_python mailing list