Sorry for a side-tracked question and if it's not appropriate i would send another email for the question.
for exactly the same global counter as in the following example, what I would like to do is to AVOID the app caching behavior. That is to say, for different requests handled by myhandler.py, i would like each request having their local value of 'counter', where 'counter' is a variable defined in an imported module (as in mymodule.py) is it possible to 'disable' the app caching behavior? - eric On 12 February 2010 17:48, saintthor <saintt...@gmail.com> wrote: > see the demo in this page:http://code.google.com/intl/en/appengine/ > docs/python/runtime.html#App_Caching > > ### mymodule.py > counter = 0 > def increment(): > global counter > counter += 1 > return counter > > > ### myhandler.py > import mymodule > > print "Content-Type: text/plain" > print "" > print "My number: " + str(mymodule.increment()) > > > do you mean if the site has not accessed for some minutes, counter > will be reset to 0? > > > On 2月12日, 下午4时24分, Tim Hoffman <zutes...@gmail.com> wrote: >> App caching could last as little as a few minutes if your site is not >> used. >> In addition if multiple instances are run then only one instance will >> have the counter with the correct value. >> >> You should store your obj in the datastore and cache it in memcache. >> >> module level caching is really only useful for cacheable things for >> each instance, >> for example compiled templates. >> >> T >> >> On Feb 12, 3:34 pm, saintthor <saintt...@gmail.com> wrote: >> >> > ### mymodule.py >> > counter = LargeObj() >> >> > ### myhandler.py >> > import mymodule >> >> > print "Content-Type: text/plain" >> > print "" >> > print "My number: " + str(mymodule.counter) >> >> > if sizeof counter is greater than 1M, can it work? >> >> > if there is no request for days, will counter still be cached? > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to google-appeng...@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.