What about pre-loading the images...
Pre-load an image...
<script>
image1 = new Image();
image1.src = "some.gif";
</script>
This will load them into the cache... ready for display.
Main Topics
Browse All TopicsI have a list that I'm building dynamically that contains about 200 entries. Beside each item, I place 3 hyperlinked images. It looks to me like web browsers are downloading these 3 images once for each record, not once for each page. This makes the download time on a modem around 1 minute.
The html for the page is about 5K, the images are around 2k combines, the reported page size when it downloads is about 200 kb.
- The images are included using the usual <img src> tags.
- The list is build in a Perl script that is included using SSI
- The webserver is Apache for linux
Anyone know how I can get the browser to download these images only once?
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Or this way if pre-loading does the job...
<script language="JavaScript"><!--
if (document.images) {
var img1 = new Image();
img1.src = 'http://www.domain.com/pat
var img2 = new Image();
img2.src = 'http://www.domain.com/pat
// ... etc for all your other images
}
// --></script>
If the three images are the same for each entry (you are reusing the same 3 images 200 times over AND the uri path is the same each time), then that shouldn't be your problem.
Taking a stab in the dark, I'd guess that the script is the trouble. The external html maybe only 5k, but having a dynamic section included into it means that the script has to run and the results effectively pasted into the html before it is shipped of to the client.
Some sample code might help us track it down more.
-corey
I couldn't post the actual script, since it is build using data from a confidential database. When I was producing the test script which I was going to link to demonstrate the problem, I noticed the error.
It turns out, the HTML page was only 5 kb and the 3 images were downloaded once. What happened is that the script also produces a javascript which consists of around ten lines. This got included one level of brackets too deep, and got spooled out 200 times onto the page (140kb of code!).
I also checked the script generation time, it was < 1 second.
Thanks everyone for your help.
Business Accounts
Answer for Membership
by: egbservicesPosted on 2001-07-29 at 21:30:23ID: 6332961
What about pre-loading the images...
Pre-load an image...
<script>
image1 = new Image();
image1.src = "some.gif";
</script>
This will load them into the cache... ready for display.