persistant web state

Jay O'Connor joconnor at nets.com
Tue May 20 12:10:29 EDT 2003


All,

I'm lloking for a technique to allow me to keep memory alive between
invocations of a cgi program.    What I mean is that if I have two cgi
requests come into a script, they should be able to access the same data
in memory and not have to load from a database.

Some context:  years ago I wrote a web server front end for Smalltalk
applications.   What this allows is that the server runs continously
between web requests and, as a result, it can cache data as Smalltalk
objects in it's own memory and not have to reload data from disk or db
between web requests.   This makes life easier for the developer as well
as providing good performance.

I'd like to carry that model over into Python, and I can think of a
couple of techniques:

Use Python CGIs, but have them get their objects from a running python
object server using either sockets or possibly stdin/stdout streams.  The
python object server would be permanatly running and would cache database
hit results as Python objects.

Use one of the Python HTTPServers and just have python handle all web
serving, keeping the objects in between requests in the server memory.

Others?  Suggestions?


-- 
Jay O'Connor
http://www.r4h-music.com

"God Himself plays the bass strings first,
when He tunes the soul"




More information about the Python-list mailing list