> > - How can I verify when the html was actually retrieved from the cache? I > tried coding a "print request.now" in the view, but that sentence is > executed everytime I hit the site's homepage, so I deduce that the code > that generates the html is executed everytime I hit the home instead of > retrieving from the cache. However, I'm not sure if that "print > request.now" is a correct indicator. >
The cache decorator just caches the output of the controller function, not the final HTML output. If you want to do the latter, then you should have the function itself directly call response.render() and return that (this technique is mentioned in the book). > - Is it possible to use server-side cache of the view but **not** browser > side? I'm specially interested in caching the view server-side, but not > browser-side. > According to the documentation, this should be possible, but looking at the code, I'm not sure it actually is. Anyway, as long as you're caching on the server, why not also let the browser cache the page? > - Users can login in my site, but homepage isn't different for logged in > users, only thing that's different is topbar showing the name of logged in > user. Is it still possible to use @cache.action? > Yes, but you'd want to set session=True to make sure each user gets a different page. In that case, though, you probably would not want to do server side caching, as you will be continually adding to the cache with no benefit over client-only caching. Also, keep in mind that values are not automatically deleted from the cache (even after they expire), so you don't want to accumulate an potentially unlimited number of cache items (you'll at least need to do some periodic cleanup). Anthony -- 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/d/optout.

