PreLoading images

T

Thomas A. Rowe

You would have to use a full absolute URL to the images, then pre-loading wouldn't really be
necessary, since the image would then be pulled from the cache after the first loading.

Note: Absolute URLs can not be managed by any HTML editor.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
M

Murray

Huh?

--
Murray

Thomas A. Rowe said:
You would have to use a full absolute URL to the images, then pre-loading
wouldn't really be necessary, since the image would then be pulled from
the cache after the first loading.

Note: Absolute URLs can not be managed by any HTML editor.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

Which part of my post should I apply the "Huh?" to?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
C

CD

Thanks for being patient with me on this.

So I understand correctly.

1) I have one nave page included that use roll over images. Ideally this is
instant for a preload. BUT since it is a included page where would the
preload code go? Since the include seems to start inside the body tag.
Does it actually read the inside the tag its self? <body bla bla options>

2) I agree some of the page images are heavy but anymore more compression
and they start to look aweful. BUT they are the same for every web site
page. Then shouldn't it come from local cache, (depending on user not
changin local settings).?

3)You would have to use a full absolute URL to the images, then pre-loading
wouldn't really be
necessary, since the image would then be pulled from the cache after the
first loading. Note: Absolute URLs can not be managed by any HTML editor.

Using the word Absolute I assume u mean www.blalba.com/images/image.gif?
So when is the case to use folder or url reference?
I sssume you mean about managing that FP would change it to folder?
 
M

Murray

You would have to use a full absolute URL to the images, then
The image is always pulled from the cache after the first loading, no matter
what kind of linking there is, provided you link to it the same way each
time.
 
M

Murray

Inline below -

--
Murray

CD said:
Thanks for being patient with me on this.

So I understand correctly.

1) I have one nave page included that use roll over images. Ideally this
is
instant for a preload. BUT since it is a included page where would the
preload code go? Since the include seems to start inside the body tag.
Does it actually read the inside the tag its self? <body bla bla options>

The preload goes in the TARGET page, not the include page.
2) I agree some of the page images are heavy but anymore more compression
and they start to look aweful. BUT they are the same for every web site
page. Then shouldn't it come from local cache, (depending on user not
changin local settings).?

Yes - if you link to the image in the same way each time.
3)You would have to use a full absolute URL to the images, then
pre-loading
wouldn't really be
necessary, since the image would then be pulled from the cache after the
first loading. Note: Absolute URLs can not be managed by any HTML editor.

Using the word Absolute I assume u mean www.blalba.com/images/image.gif?

Actually http://www.domain.com/images/image.gif
So when is the case to use folder or url reference?

When it's on someone else's site.
 
T

Thomas A. Rowe

Not true, if you have your browser set to not cache content.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

See inline below

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


CD said:
Thanks for being patient with me on this.

So I understand correctly.

1) I have one nave page included that use roll over images. Ideally this is
instant for a preload. BUT since it is a included page where would the
preload code go? Since the include seems to start inside the body tag.
Does it actually read the inside the tag its self? <body bla bla options>

When you use FP Include Page component, only the content that is between the body tags is inlcuded
in other pages.
2) I agree some of the page images are heavy but anymore more compression
and they start to look aweful. BUT they are the same for every web site
page. Then shouldn't it come from local cache, (depending on user not
changin local settings).?

Yes, as long as the path to the image is same for all pages. FP works with relative paths, so page
in the root of the web would have the following path to the images folder:

"images/image.gif"

a page locate 1 folder down from root would have a path of:

"../images/image.gif"

So you now have two of the same images in your cache folder, so the only use of the cache images
would be all pages at the same level.

If you use a Absolute Path, like:

http://www.domainname.com/images/image.gif

then image is downloaded once and stored in the cache folder, then any page in the site will use the
same cached image.

3)You would have to use a full absolute URL to the images, then pre-loading
wouldn't really be
necessary, since the image would then be pulled from the cache after the
first loading. Note: Absolute URLs can not be managed by any HTML editor.

Using the word Absolute I assume u mean www.blalba.com/images/image.gif?
So when is the case to use folder or url reference?
I sssume you mean about managing that FP would change it to folder?

If you use Absolute URL/Paths and you rename or move a image (in this case), FP will not update the
name or location of the image in the page linked to the image with an Absolute Path.
 
M

Murray

Well, who has it set there? Who even knows it could be? But thanks for the
clarification. 8)

So - I'm confused though. You have your browser set not to cache content,
yet you say that by doing this it will cache the image. Doesn't this make
lightning shoot out of your hard drive or something?
 
T

Thomas A. Rowe

If your browser is set to cache content (the default), then it will always pull from the cache
before going back to the server for content.

IMO: Web developers should always have caching disabled, so that they can immediately see any
changes they are making to pages during development.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
M

Murray

IMO: Web developers should always have caching disabled, so that they can
immediately see any changes they are making to pages during development.

Certainly true. What about the caching when using absolute links, even when
you have caching turned off, though?
 
T

Thomas A. Rowe

IE appears to still cache so of the images. I give...

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

I know.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Trevor L.

Murray and Thomas,

I was interested by the exchange I and didn't regard it as a contest. I also
wanted to know when caching occurs and I think reading (and re-reading) this
thread will help me. I am curious as to why my background image is now
cached when it wasn't before. All I did was change it to an absolute
reference http://tandcl.homemail.com.au/images/04-08-24-1-bird-bath.jpg
rather than a relative reference images/04-08-24-1-bird-bath.jpg. And yet I
am sure that somewhere in this thread. it was stated that the image would be
cached provided it was always referred to in the same way. Before I made it
absolute, it was referred to the way, in fact it was only referred to once -
in style.css as a background.
i.e.
body, frameset {background:
url(http://tandcl.homemail.com.au/images/04-08-24-1-bird-bath.jpg) ;}

Still, if it ain't broke , .....

Murray, I will try to get the first page down to 45-50K. My picture is now
49K, after reducing JPEG quality in IrfanView. I don't think the other
images and text take much more, but I will check it.

I would appreciate it if someone could tell me whether my preload code is
correct. Then if I decide to use it, I will know that it works.

In index.html
<frameset rows ="65,*" onload="PreLoad()">

In external.js
function PreLoad()
{
var images = new Array();
for (i=1;i<=12;i++)
{ var "myimage" + i = images[i-1] = new Image();}

myimage1.src =
"http://tandcl.homemail.com.au/images/04-08-24-1-bird-bath.jpg";

myimage2.src = "http://tandcl.homemail.com.au/images/parchmnt.gif"
;
myimage3.src =
"http://tandcl.homemail.com.au/images/thumbnails/trevor.jpg" ;
myimage4.src =
"http://tandcl.homemail.com.au/images/thumbnails/carole.jpg" ;
........................
}
--
Many Thanks,
Trevor L.

P.S. This forum is a great resource



I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
M

Murray

In index.html
<frameset rows ="65,*" onload="PreLoad()">

Buzzer. That would go in the body tag of one of the frame pages, I think,
not in the frameset page.

The rest looks fine (also belongs in a frame page - the same one with the
preload call, not the frameset)

--
Murray

Trevor L. said:
Murray and Thomas,

I was interested by the exchange I and didn't regard it as a contest. I
also wanted to know when caching occurs and I think reading (and
re-reading) this thread will help me. I am curious as to why my background
image is now cached when it wasn't before. All I did was change it to an
absolute reference
http://tandcl.homemail.com.au/images/04-08-24-1-bird-bath.jpg rather than
a relative reference images/04-08-24-1-bird-bath.jpg. And yet I am sure
that somewhere in this thread. it was stated that the image would be
cached provided it was always referred to in the same way. Before I made
it absolute, it was referred to the way, in fact it was only referred to
once - in style.css as a background.
i.e.
body, frameset {background:
url(http://tandcl.homemail.com.au/images/04-08-24-1-bird-bath.jpg) ;}

Still, if it ain't broke , .....

Murray, I will try to get the first page down to 45-50K. My picture is now
49K, after reducing JPEG quality in IrfanView. I don't think the other
images and text take much more, but I will check it.

I would appreciate it if someone could tell me whether my preload code is
correct. Then if I decide to use it, I will know that it works.

In index.html
<frameset rows ="65,*" onload="PreLoad()">

In external.js
function PreLoad()
{
var images = new Array();
for (i=1;i<=12;i++)
{ var "myimage" + i = images[i-1] = new Image();}

myimage1.src =
"http://tandcl.homemail.com.au/images/04-08-24-1-bird-bath.jpg";

myimage2.src = "http://tandcl.homemail.com.au/images/parchmnt.gif" ;
myimage3.src =
"http://tandcl.homemail.com.au/images/thumbnails/trevor.jpg" ;
myimage4.src =
"http://tandcl.homemail.com.au/images/thumbnails/carole.jpg" ;
........................
}
--
Many Thanks,
Trevor L.

P.S. This forum is a great resource



I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
T

Trevor L.

Murray,

Thanks muchly.

Yes, I thought that I should put it into the body tag of a frame, say the main frame (index_main.html), but then I thought that if I put it into the frameset (index.html) then it will execute before any frame is called which would mean there would be no delay in displaying the image when the main frame loads.

Is this wishful thinking?
I think I read somewhere in this forum that using <body onload ="xx"> will execute "xx" after the completion of the code in <body> </body>, and not at the point where it placed (i.e. before the code). Since the code within <body> </body> loads the framesets, one of which contains the image, it would be pointless.

Do I read this correctly?
--
Thanks,
Trevor L.


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
T

Thomas A. Rowe

Put it in the body tag of the frameset, so that it will only preload once and this would be prior to
any of the pages loading in the frameset.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


Murray,

Thanks muchly.

Yes, I thought that I should put it into the body tag of a frame, say the main frame
(index_main.html), but then I thought that if I put it into the frameset (index.html) then it will
execute before any frame is called which would mean there would be no delay in displaying the image
when the main frame loads.

Is this wishful thinking?
I think I read somewhere in this forum that using <body onload ="xx"> will execute "xx" after the
completion of the code in <body> </body>, and not at the point where it placed (i.e. before the
code). Since the code within <body> </body> loads the framesets, one of which contains the image, it
would be pointless.

Do I read this correctly?
--
Thanks,
Trevor L.


I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
T

Trevor L.

Thanks to Murray and Thomas,

I placed the Preload function into external.js. The code was as I posted
here but it failed to execute (error on page)

It was called as here in index.html

<frameset rows ="65,*" onload="PreLoad()">

So it looks like the call is in the correct place, but the code itself is
incorrect.

Could this code be wrong
for (i=1;i<=12;i++)
{ var "myimage" + i = images[i-1] = new Image();}

Should it perhaps be
for (i=1;i<=12;i++)
{ var "myimage" + i = images[eval(i-1)] = new Image();}
or something similar
--
Cheers,
Trevor L.



I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html
 
T

Thomas A. Rowe

Trevor,

Sorry, I can't help you with your preload script, as I don't use any.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top