[web2py] Re: GAE Caching and Views

2011-11-29 Thread howesc
Constantine, do you mind sharing what and how you are serializing things with protocol buffers? perhaps we can adapt what you are doing into the web2py GAE caching core. JT - thanks for the nice writeup. i'm working on optimizing some web2py apps for customers now, and should be using your te

[web2py] Re: GAE Caching and Views

2011-11-29 Thread Constantine Vasil
>not picklable there is a way to serialize with protocol buffers. I am using it in my code but it better be implemented in the web2py core as a 'gae' dependency.

[web2py] Re: GAE Caching and Views

2011-11-28 Thread johntynan
Thanks everyone for your excellent help! I posted an account of enabling caching with web2py on GAE in a blog post here: http://opensourcebroadcasting.blogspot.com/2011/11/web2py-caching-and-google-app-engine.html All the best, JT

Re: [web2py] Re: GAE Caching and Views

2011-11-25 Thread Bruno Rocha
On Tue, Nov 22, 2011 at 8:34 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > . I have never tried it on GAE I have a select cache on my app, works locally, but fails on GAE. It does not raise any exception but does not cache anything, and I only realized it does not works when I see

[web2py] Re: GAE Caching and Views

2011-11-25 Thread howesc
hmmm, i've never known GAE to cache selects. at one point i thought the book said as much, now it simply says: "The results of a select are complex, un-pickleable objects; they cannot be stored in a session and cannot be cached in any other way than the one explained here." and i believe that

[web2py] Re: GAE Caching and Views

2011-11-22 Thread Massimo Di Pierro
select(cache) does not serielizes Rows but the dictionary returned by the select. I have never tried it on GAE. For sure you cannot cache in run but it should be possible to cache.memcache. If that does not work it is because the datastore returns a type that is not serializible. On Nov 22, 3:26 p

[web2py] Re: GAE Caching and Views

2011-11-22 Thread howesc
actually, unless something changed on on GAE, select caching does not work because the rows object is not picklable. the @cache decorator caches the dict that you return to the view, not the rendered view. if something in that dict is not picklable (say a rows object) the cache will fail. ant

[web2py] Re: GAE Caching and Views

2011-11-22 Thread Anthony
How about: return response.render(dict(pledges=pledges)) An alternative is just to cache the select instead of the whole view: pledges=db((db.pledge.segment==segment_id) & (db.pledge.read == False)).select(orderby=~db.pledge.created_on, cache=(cache.ram, 5)) In that case, you would remo