Hello Anthony
Yes I want the content to be cached by the browser. And thanks to you
now I can control exactly how much time the pages are cached! The link
was very usefull and the efficency has improve dramatically. Imho a
must if you want to do dinamics web apps.
Im still doing some tests and for my proyect caching the page 30 Min
works fine
#Cache Control
del response.headers['Pragma']
del response.headers['Expires']
response.headers['Cache-Control']= 'max-age=1800, must-
revalidate'
Thank you very much Anthony. The web2py community is awesome.
On 9 oct, 13:39, Anthony <[email protected]> wrote:
> web2py provides server-side caching capability, but it sounds like you want
> the content to be cached by the browser. Browser caching is controlled by
> the response headers. By default, the response headers for static files are
> set so the browser will cache, but not for pages served dynamically by
> web2py. I suppose you could set the response headers for your Ajax requests
> to cache -- check out some online resources for the appropriate settings
> (e.g.,http://www.mnot.net/cache_docs/). You can set web2py response headers
> by adding to response.headers, which is a dictionary:
>
> response.headers['Header-Name-Goes-Here'] = 'header-value-goes-here'
>
> Another option might be to cache the Ajax requests using Javascript (but I
> guess the cache will only survive while the user remains on a given
> page):http://davidwalsh.name/cache-ajax.
>
> Anthony
>
>
>
>
>
>
>
> On Sunday, October 9, 2011 1:10:42 AM UTC-4, luismurciano wrote:
>
> > Hello everyone
>
> > Im using clueTiphttp://plugins.learningjquery.com/cluetip/a fancy
> > tooltip js lib to show some adition info. That information is loaded
> > via AJAX.
> > clueTip is very easy, works well with web2py and loads asynchronously.
> > I want to cache the requested information for efficiency but it seems
> > to do cache only from statics pages.
>
> > Example:
> > <h4 title="Fancy Title!" id={{ =URL( 'static' , 'info.html' ) }}>Hover
> > over me</h4>
> > $('h4').cluetip({attribute: 'id', hoverClass: 'highlight'});
>
> > but if the page isnt static, defined in a controller, clueTip doesn't
> > cache the request at all.
>
> > I dont know why thats happens, and I dont even know if is an issue
> > from clueTip or Web2py.
> > I can do it using some hacks (loading the info in a div and showing it
> > on mouseover) but isnt very clean.
>
> > Any thoughts?