Correct, that's a no. If you like that style, I'd suggest you check
out CherryPy -- their handler objects are long living.

webpy's controller system is, however, threaded, so any state can be
stored globally or in class variables. Something like:

class Index:
  _cache = {}

  def GET(self):
    inp = web.input()
    if not inp.key in self._cache:
      self._cache[inp.key] = "check out my neat string"
    return self._cache[inp.key]

Is there something in particular you're trying to do that you can't do
with this model?

On Nov 13, 5:26 am, Adrian Petrescu <[email protected]> wrote:
> I see. So I'm guessing that's a no, then? =/
>
>
>
>
>
>
>
> On Sat, Nov 13, 2010 at 5:10 AM, Dragan Espenschied <[email protected]> wrote:
> > Hi Adrian,
> > I think you should configure your web server for doing same request
> > caching.
> > Or, if you have lots of URLs that will be accessed over and over, it's
> > probably
> > best to generate static html files instead of doing it on the fly.
> > Bests,
> > drx
>
> > Am 13.11.2010 11:06, schrieb Adrian Petrescu:
> > > Hey guys,
>
> > > I've been using web.py for approximately two hours, so bear with me.
> > > Basically I have a GET handler assigned to a URL and everything's
> > > working, but I'm noticing that web.py is actually instantiating a new
> > > handler object for each request that comes in. Is it possible to have
> > > it create just one instance, and keep on calling the GET method of the
> > > same one over again?
>
> > > Note that I'm not asking for sessions, it's nothing per-user, I
> > > basically just want to be able to do some caching of requests that
> > > have come in before.
>
> > > Is this possible?
> > > Thanks!
> > > -Adrian
>
> > --
> >http://noobz.cc/
> >http://digitalfolklore.org/
>
> > --
> > 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] <webpy%[email protected]>.
> > For more options, visit this group at
> >http://groups.google.com/group/webpy?hl=en.

-- 
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