[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread mdipierro
pseudocode here: {{ if data is in cache: retrieve data and print it here else: print JS code to retrieve data later }} For this purpose I would implement cache as a db based queue of tasks to be completed. On Jan 20, 5:50 pm, frollings wrote: > Ah yes, but how to make the second page load

[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread frollings
Ah yes, but how to make the second page load not use Ajax at all, but only a flat HTML page? On Jan 21, 12:08 am, mdipierro wrote: > Yes but the point is the same. You can have a controller generate the > block. You load it via ajax. You still cache the block serverside. > > On Jan 20, 4:55 pm, f

[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread mdipierro
Yes but the point is the same. You can have a controller generate the block. You load it via ajax. You still cache the block serverside. On Jan 20, 4:55 pm, frollings wrote: > But it's not about the images only; it's about the entire block you > see there; > > Blocks are the blocks you see like;

[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread frollings
But it's not about the images only; it's about the entire block you see there; Blocks are the blocks you see like; - Basic Website Information - Traffic Graphs - SEO Graphs etc They contain text or text + graphs. So It's not about the images; it's about an entire 'block of html' that is being lo

[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread mdipierro
I am looking at the page with firebug. The code that reads the images sees to be http://traffic.alexa.com/graph? r=6m&y=r&w=280&h=179&u=web2py.com"/> So my guess is that http://traffic.alexa.com/graph does the caching and perahps also if request.env.http_if_modified_since: raise HTTP(30

[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread frollings
I'm not sure if that's the same (I read that page already before). A good example is http://www.statsmogul.com. Enter a url that is not yet in there and see what happens (scroll down during loading) and when all boxes are fully loaded, refresh the page. That's exactly what I would want to accomplis

[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread mdipierro
I understand now. You can cache any function http://www.web2py.com/examples/default/examples#cache_examples You should cache the function that returns the images. Mind that if you have a of these, caching in ram may cause a memory leak. You probably should cache on disk or memcache (if available)

[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread frollings
Hi, No not quite it, let me try to re-explain; I have a page, per domain that we gather statistics on for our clients, 9 boxes with graphs and text (IE a bunch of HTML which happens to contain 1+ image each). Those 'boxes' contain content that takes time to generate (few seconds per box), so I wa

[web2py] Re: 1 time async generation, pure HTML caching

2010-01-20 Thread mdipierro
Let me understand better,. You are looking at caching images. Do you want to cache per session (per user) or across sessions? Are you talking about cache serverside (when image is requested second time it not recomputed) or clientside (the client not even try to request the image the second time)?