Hi,
I'm having difficulty setting up cache on GAE.
@cache(request.env.path_info, time_expire=60*60, cache_model=cache.ram)
def index():
index = db(db.page.sequence==0).select(db.page.title, db.page.body, db.
page.side, cacheable=True).first()
return dict(index=index)
Using the above code in the GAE SDK I get the following error message:
PicklingError: Can't pickle <class 'gluon.dal.page'>: attribute lookup
gluon.dal.page failed
If I use response.render on the returned dict the cache seems to work, but
I have a personalised welcome message and that becomes cached too. Also
checking the GAE dash for request type it has no record of cached requests
being serviced only dynamic and static.
I've also tried using cached select:
def index():
index = db(db.page.sequence==0).select(db.page.title, db.page.body, db.
page.side, cache=(cache.ram, 1200), cacheable=True).first()
return dict(index=index)
The page will load up fine, but when I make a change to the page it comes
through instantly... leading me to belive it hasn't been cached at all.
Thanks in advance for your help.
-James
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.