Forum Moderators: open

Message Too Old, No Replies

Ensure Images Load Last?

Possible or not?

         

Nick_W

4:12 pm on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

I have a site that hotlinks to images on a VERY busy server. This slows down my page load considerably at peak times.

Is there any way to ensure that images are downloaded last?

Nick

too much information

4:22 pm on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would think the images are going to load at their own time, but you can get the rest of the page layout to complete by specifying your height and width in your image tags.

You also may want to specify a lowsrc for your image tags with a very small gif on your own server as a place holder until the images load.

(not trying to go too basic on you, but it may help)

too bad you don't have copies of the images on your own, that would solve your entire problem.

Nick_W

4:27 pm on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>too bad you don't have copies of the images on your own, that would solve your entire problem.

Absolutely. No chance though, I'd have to pop 500k plus images on there I reckon ;)

lowsrc?

Nick

trillianjedi

5:11 pm on Aug 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



lowsrc?

lowsrc [htmlgoodies.com]

TJ

[edited by: tedster at 8:07 pm (utc) on Aug. 22, 2003]
[edit reason] fix display code [/edit]

seindal

8:55 pm on Aug 23, 2003 (gmt 0)

10+ Year Member



You can get it to load delayed by using javascript and setTimeout().

René

GaryK

9:00 pm on Aug 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are the pictures static for a long enough period of time that you could cache them locally?

MonkeeSage

10:06 pm on Aug 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nick:

<script type="text/javascript">
<!--
// change array length to 1 based image count
var imgs = new Array(3);
imgs[0] = "img1.png";
imgs[1] = "img2.png";
imgs[2] = "img3.png";
// add more imgs here

function loadImgs() {
var j = 0;
for (var i = 0; i < document.images; ++i) {
j = ++i;
j = j.toString();
document.getElementById("img" + j).src = imgs[i];
}
}
//-->
</script>

<img id="img1" src="" alt="picture one" width="50" height="20"/>
<img id="img2" src="" alt="picture two" width="50" height="20"/>
<img id="img3" src="" alt="picture three" width="50" height="20"/>
...

<script type="text/javascript">
<!--
void(loadImgs());
//-->
</script>
</body>

Mabye that will do the trick?

Jordan