Best way to cache a bunch of images on the client? Possible to "stream" image info for caching after

Discussion in 'ASP .Net' started by Guest, Jun 16, 2007.

  1. Guest

    Guest Guest

    I've built an application that scrapes JPG images of webpages and PDF
    instances of those webpages automatically from an RSS feed. References to
    the scraped resources are persisted to our database. I've also built an
    administrative interface that allows someone to scroll through a datalist of
    the JPG images of the page and to delete the unwanted items.

    The JPG previews of the webpage are rendered in several sizes: iconic,
    mid-sized 600px cropped, and full-sized, full-length webpage images.

    The purpose of the JPG preview images of the webpages is to eliminate the
    annoying latencies associated with reviewing stuff on the web. Because they
    are pre-rendered JPG images of webpages, there is no need for the user's
    browser to contact a remote server, download a webpage, render that webpage,
    etc. etc. This matters when you are dealing with dozens or hundreds of
    items.

    Given this background, what is the best way that I might precache all of
    these preview images on the user's browser? The idea behind the caching is
    that they would have near-instaneous access to the image data for the small,
    medium, and large preview images.

    Other info:
    I can easily build an ArrayList of the images' URLs that I want to cache.

    The images will show up through regular ASP.NET postbacks and through AJAX
    widgets (Thickbox), though I doubt that matters.

    Ideally I could make this so that all of the small images would download
    BEFORE the page is rendered, and the medium and large images would stream in
    AFTER the small images/page was rendered, but while the user was still
    browsing through the list.

    Not sure if this is ASP.NET specific at all, though I will be running this
    on an ASP.NET page and an ASP.NET 2.0-equipped server if that helps.

    Thanks for any help you can throw my way.

    -KF
     
    Guest, Jun 16, 2007
    #1
    1. Advertising

  2. Guest

    bruce barker Guest

    Re: Best way to cache a bunch of images on the client? Possible to"stream" image info for caching after inital page render?

    the only way to cache is to ask the browser to download the image. ther
    are two common appoaches:

    1: use a zero size img tag
    2: in javascript

    var img = new Image();
    img.src = "myimage.jpg";

    the browser will only download 2 images at a time. in javascript you can
    check the img.readyState to see if the image has been downloaded. the
    browser will fire onload after parse but before all images are downloaded.

    -- bruce (sqlwork.com)

    am wrote:
    > I've built an application that scrapes JPG images of webpages and PDF
    > instances of those webpages automatically from an RSS feed. References to
    > the scraped resources are persisted to our database. I've also built an
    > administrative interface that allows someone to scroll through a datalist of
    > the JPG images of the page and to delete the unwanted items.
    >
    > The JPG previews of the webpage are rendered in several sizes: iconic,
    > mid-sized 600px cropped, and full-sized, full-length webpage images.
    >
    > The purpose of the JPG preview images of the webpages is to eliminate the
    > annoying latencies associated with reviewing stuff on the web. Because they
    > are pre-rendered JPG images of webpages, there is no need for the user's
    > browser to contact a remote server, download a webpage, render that webpage,
    > etc. etc. This matters when you are dealing with dozens or hundreds of
    > items.
    >
    > Given this background, what is the best way that I might precache all of
    > these preview images on the user's browser? The idea behind the caching is
    > that they would have near-instaneous access to the image data for the small,
    > medium, and large preview images.
    >
    > Other info:
    > I can easily build an ArrayList of the images' URLs that I want to cache.
    >
    > The images will show up through regular ASP.NET postbacks and through AJAX
    > widgets (Thickbox), though I doubt that matters.
    >
    > Ideally I could make this so that all of the small images would download
    > BEFORE the page is rendered, and the medium and large images would stream in
    > AFTER the small images/page was rendered, but while the user was still
    > browsing through the list.
    >
    > Not sure if this is ASP.NET specific at all, though I will be running this
    > on an ASP.NET page and an ASP.NET 2.0-equipped server if that helps.
    >
    > Thanks for any help you can throw my way.
    >
    > -KF
    >
    >
     
    bruce barker, Jun 16, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?b25l?=
    Replies:
    1
    Views:
    5,331
    Karl Seguin [MVP]
    Mar 8, 2006
  2. Smokey Grindle

    Caching js and images on client

    Smokey Grindle, Jul 7, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    438
    John Timney \(MVP\)
    Jul 7, 2006
  3. wardemon

    Cache Images vs Static Images

    wardemon, Jun 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    676
    bruce barker
    Jun 14, 2007
  4. kevin
    Replies:
    1
    Views:
    388
    Kairi Zikpin
    Jul 21, 2006
  5. Ed
    Replies:
    8
    Views:
    92
    Eric Pozharski
    Aug 25, 2008
Loading...

Share This Page