I'm surprised no one has attempted to do anything similar ever
Surely you'd want to be caching non permanent data in a session
somehow. Isn't that half the point of sessions?
On Apr 2, 2:02 pm, Beau <[email protected]> wrote:
> Howdy.
>
> Been playing around with web.py and mimerender to create a simple site
> that translates other connections into RESTful urls (with json/html/
> xml responses).
>
> Some of this URLs currently open a TCP connection, and close it upon
> completion. This works fine, however it's probably not the best going
> forward. What I would like to do is cache the connection object for a
> 'session'. So if the user continually polls my service for data, it's
> not creating a new connection, getting the data and then closing it.
> I'd rather it lookup the connection and use an existing one.
>
> I've thought about using sessions, then using a dictionary for the
> sessionid to contain the object info etc. This could work, but I would
> like to close the connection if the session expires.
>
> Is there a method/interface that gets called when a session expires?.
> So I don't leave open TCP connections around the place.
>
> Is it possible to store the session info in memory only?. The session
> information does not need to be persistent, or even last longer than
> one minute (perfectly acceptable to open a new connection if the
> requests are one minute apart, but some may be 100ms apart). So
> writing to the disk seems odd :S.

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to