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 <mdipie...@cs.depaul.edu> 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, frollings <tluy...@gmail.com> 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;
>
> > - 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 loaded async the first time and
> > retrieved from cache the
> > second time.
>
> > On Jan 20, 7:39 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > I am looking at the page with firebug. The code that reads the images
> > > sees to be
>
> > > <img height="179" src="http://traffic.alexa.com/graph?
> > > r=6m&y=r&w=280&h=179&u=web2py.com"/>
>
> > > So my guess is thathttp://traffic.alexa.com/graph
>
> > > does the caching and perahps also
>
> > >         if request.env.http_if_modified_since: raise HTTP(304)
>
> > > to avoid serving the image more then once to the same client.
>
> > > On Jan 20, 11:51 am, frollings <tluy...@gmail.com> wrote:
>
> > > > I'm not sure if that's the same (I read that page already before). A
> > > > good example
> > > > ishttp://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 accomplish.
>
> > > > If cache does that it's great, but I don't think so?
>
> > > > Thanks!
>
> > > > On Jan 20, 6:45 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > I understand now. You can cache any 
> > > > > functionhttp://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).
>
> > > > > On Jan 20, 11:30 am, frollings <tluy...@gmail.com> wrote:
>
> > > > > > 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 want them
> > > > > > to show AJAX loading. So every 'box' shows up (with it's html which 
> > > > > > is
> > > > > > generated in the
> > > > > > background) when it was done generating.
>
> > > > > > When another user (or the same user) revisits the page within a
> > > > > > settable (by the programmer)
> > > > > > time-out (let's say 1 day), it should show only HTML with the 
> > > > > > content
> > > > > > that was generated
> > > > > > the first time using the AJAX calls.
>
> > > > > > So the cache is not per session or user; it's per everyone viewing
> > > > > > that page for 1 day long and then it goes to generating it again.
>
> > > > > > Does that make sense?
>
> > > > > > Thanks,
>
> > > > > > Frank
>
> > > > > > On Jan 20, 5:50 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > > > > > 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)? I assume the graphs are 
> > > > > > > images.
> > > > > > > Are they?
>
> > > > > > > On Jan 20, 10:01 am, frollings <tluy...@gmail.com> wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > I'm writing a simple statistic analysis system using web2py; 
> > > > > > > > when a
> > > > > > > > user requests a stats page for a certain site, it will show 9 
> > > > > > > > graphs.
> > > > > > > > I want each of these 9 graphs to generate async (so the user 
> > > > > > > > sees 9
> > > > > > > > loading images which, randomly, turn into graphs when that 
> > > > > > > > specific
> > > > > > > > graph is done), but when the user re-requests, I don't want any 
> > > > > > > > JS/
> > > > > > > > AJAX anymore but just a static HTML showing the graphs (which 
> > > > > > > > all have
> > > > > > > > some text values as well).
>
> > > > > > > > What is the best pattern in web2py to accomplish this?
>
> > > > > > > > We are porting from PHP where this was implemented as a bit of 
> > > > > > > > a hack
> > > > > > > > (pseudocode);
>
> > > > > > > > if ($newload) {
>
> > > > > > > >           $(".stats-visits .box-content").load('result.php', 
> > > > > > > > array
> > > > > > > > ('id', $dom['id'], 'blk', 'stats-visits')).'");
> > > > > > > > etc
> > > > > > > > etc
>
> > > > > > > > } else {
>
> > > > > > > >  show_static($dom['id']);
>
> > > > > > > > }
>
> > > > > > > > I would imagine web2py has a nicer/better pattern for this kind 
> > > > > > > > of
> > > > > > > > thing?
>
> > > > > > > > Thank you
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to