473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
Jun 15 '07 #1
1 2221
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)

ke*****@nospam.nospam 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

Jun 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Stock | last post by:
Hi all, hopefully someone can tell me how to do this for a web server in C#: We have images in a folder you can't access over the net. So everytime we need to display an image from this folder,...
2
by: CVerma | last post by:
I'm using an html input control (System.web.UI.HTMLControls.HTMLInputFile) to upload files such as msword, excel, jpg, and pdf. I have the encType property set in the form:...
6
by: Tom Kaminski [MVP] | last post by:
I can do this in ASP, but not sure how to handle in ASP.NET: How To Use the ADODB.Stream Object to Send Binary Files to the Browser through ASP http://support.microsoft.com/?kbid=276488 Do I...
4
by: Jon | last post by:
Hello all, I have an image which is being returned to me as a MemorySteam. I want to dislpay this out onto the browser. Is the below all I should need to do? ...
4
by: Lopamudra | last post by:
Hi, I am displaying thumbnails of images in the way Google does in its Image Search. i.e along with the details on the image height, width, size in KB and file type. I am using a http handler...
5
by: chandanlinster | last post by:
When I was reading the man-page of fflush, I came across this statement --- "The function fflush forces a write of all user-space buffered data for the given output or update stream via the...
5
by: StephQ | last post by:
At the moment I have a void member function (of a given class) that takes as input an obj of class type ofstream and write some debug information to it using the << operator. I would like to...
4
by: =?utf-8?B?Qm9yaXMgRHXFoWVr?= | last post by:
Hello, (sorry to begin with Java in a Python list ;-) in Java, when I want to pass input to a function, I pass "InputStream", which is a base class of any input stream. In Python, I found...
0
by: RobUK | last post by:
We have Apache on the local network managing several websites that are accessed using virtual domains (configured in the local machine's hosts file, eg. 192.168.1.10 points to dev.somedomain.com). ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.