On Monday, October 21, 2013 8:25:22 AM UTC+2, Mark Li wrote:
>
> I have 2 questions about cache.action
>
> Firstly, I am looking into cache.action to cache several static pages 
> (about, contact, etc), that rarely change content.
>
> For users who aren't logged in, the pages would be the same. However, if a 
> user is logged in, then there are links to the users' profile, as well as a 
> logout link; thus making the page different for every user, and different 
> for logged-in vs. non-logged-in users. Is there any way to effectively 
> cache these pages, or only cache the non-logged in page for non-logged in 
> viewers?
>

if your page has the same url and serves different contents for logged and 
non-logged users, and logged users get everyone a different content, than 
you should cache it with the User parameter.
 

>
>
> Secondly, cache.action can't be used to cache views with database selects. 
> However, if the database select was converted to a list/dict, with 
> as_list() or as_dict(), would caching the page with cache.action be 
> possible (this would make it pickleable as a regular dictionary)?
>

Why ? cache.action just caches the rendered view. It doesn't matter how 
many select()s you do in that controller. 

>
> Would there be a significant improvement of using cache.action to cache 
> the view that has a database select, over simply caching the select?
>

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

Reply via email to