473,379 Members | 1,270 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,379 software developers and data experts.

many images delay even when cached

I have a page with about 100 images of about 10k each.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">
Not all the images need to be viewed at once, depending on what category is
selected, only about 10 images are seen at any one time.
I hide and show categories of images by setting a div container
display:none/block or visibility:hidden/visible.

Even though the images are cached on the client, when the page loads in ie,
there is still a few seconds delay while it counts down until there are no
items remaining.
In firefox there is the same delay but instead of counting down it just says
'waiting for..'

From what i understand, the way to get around this delay when loading is not
to set the src of the image tags until later, when the images need to be
viewed (using javascript).
That's not a problem and i have tried it, and it works, but now (for some
reason) the browser forgets that the images have been cached whenever the
user returns to the site, and has to download the images from the server,
the first time a particular category of images is viewed.
This, i presume, is happening because the src attribute is no longer
hard-coded in the source, and the browser cannot associate an entry in the
cache with the src of an image that is set via javascript?

So it looks like the only solution may be to generate the html on the fly,
when it is needed, with the src intact, or to use frames to get the html
when it is needed.

Am i missing something here?
Thanks.
Jul 26 '05 #1
10 1844
cosmic foo wrote:
I have a page with about 100 images of about 10k each.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">
Not all the images need to be viewed at once, depending on what category is
selected, only about 10 images are seen at any one time.
I hide and show categories of images by setting a div container
display:none/block or visibility:hidden/visible.

Even though the images are cached on the client, when the page loads in ie,
there is still a few seconds delay while it counts down until there are no
items remaining.
In firefox there is the same delay but instead of counting down it just says
'waiting for..'

From what i understand, the way to get around this delay when loading is not
to set the src of the image tags until later, when the images need to be
viewed (using javascript).
That's not a problem and i have tried it, and it works, but now (for some
reason) the browser forgets that the images have been cached whenever the
user returns to the site, and has to download the images from the server,
the first time a particular category of images is viewed.
This, i presume, is happening because the src attribute is no longer
hard-coded in the source, and the browser cannot associate an entry in the
cache with the src of an image that is set via javascript?

So it looks like the only solution may be to generate the html on the fly,
when it is needed, with the src intact, or to use frames to get the html
when it is needed.

Am i missing something here?
Thanks.

you could try a css method for preloading?:

http://www.ilovejackdaniels.com/css/...ages-with-css/
Jul 26 '05 #2

"Jedi Fans" <"news[at]jedifans[--=dot==-]com"> wrote in message
news:42**********@mk-nntp-2.news.uk.tiscali.com...
cosmic foo wrote:
I have a page with about 100 images of about 10k each.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">
Not all the images need to be viewed at once, depending on what category is selected, only about 10 images are seen at any one time.
I hide and show categories of images by setting a div container
display:none/block or visibility:hidden/visible.

Even though the images are cached on the client, when the page loads in ie, there is still a few seconds delay while it counts down until there are no items remaining.
In firefox there is the same delay but instead of counting down it just says 'waiting for..'

From what i understand, the way to get around this delay when loading is not to set the src of the image tags until later, when the images need to be
viewed (using javascript).
That's not a problem and i have tried it, and it works, but now (for some reason) the browser forgets that the images have been cached whenever the user returns to the site, and has to download the images from the server, the first time a particular category of images is viewed.
This, i presume, is happening because the src attribute is no longer
hard-coded in the source, and the browser cannot associate an entry in the cache with the src of an image that is set via javascript?

So it looks like the only solution may be to generate the html on the fly, when it is needed, with the src intact, or to use frames to get the html
when it is needed.

Am i missing something here?
Thanks.

you could try a css method for preloading?:

http://www.ilovejackdaniels.com/css/...ages-with-css/


Thanks but wouldn't that just retain the delay when the page loads, which i
am trying to avoid?
What would be great is if display:none caused an image not to load until it
was changed to display:block.
Either that or if there was some way to set the src of an image using
javascript and still have it cached
when you return to the site.
Jul 26 '05 #3
cosmic foo wrote:
"Jedi Fans" <"news[at]jedifans[--=dot==-]com"> wrote in message
news:42**********@mk-nntp-2.news.uk.tiscali.com...
cosmic foo wrote:
I have a page with about 100 images of about 10k each.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">
Not all the images need to be viewed at once, depending on what category is selected, only about 10 images are seen at any one time.
I hide and show categories of images by setting a div container
display:none/block or visibility:hidden/visible.

Even though the images are cached on the client, when the page loads in ie, there is still a few seconds delay while it counts down until there are no items remaining.
In firefox there is the same delay but instead of counting down it just says 'waiting for..'

From what i understand, the way to get around this delay when loading is not to set the src of the image tags until later, when the images need to be
viewed (using javascript).
That's not a problem and i have tried it, and it works, but now (for some reason) the browser forgets that the images have been cached whenever the user returns to the site, and has to download the images from the server, the first time a particular category of images is viewed.
This, i presume, is happening because the src attribute is no longer
hard-coded in the source, and the browser cannot associate an entry in the cache with the src of an image that is set via javascript?

So it looks like the only solution may be to generate the html on the fly, when it is needed, with the src intact, or to use frames to get the html
when it is needed.

Am i missing something here?
Thanks.

you could try a css method for preloading?:

http://www.ilovejackdaniels.com/css/...ages-with-css/


Thanks but wouldn't that just retain the delay when the page loads, which i
am trying to avoid?
What would be great is if display:none caused an image not to load until it
was changed to display:block.
Either that or if there was some way to set the src of an image using
javascript and still have it cached
when you return to the site.

not sure lol, sorry
Jul 26 '05 #4
cosmic foo wrote:
I have a page with about 100 images of about 10k each.
That's just short of a megabyte page -- huge!
Maybe 50 times the size a page should be.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">
...
I hide and show categories of images by setting a div container
display:none/block or visibility:hidden/visible.


....all of which means that anyone browsing in with javascript off
doesn't get to play. Maybe this will help:
http://www.mbstevens.com/howtothumb/
Even without seeing more of the source, what you're doing looks like
nightmare code to me -- but you should post the address so people can
look it over.
Jul 26 '05 #5
Tim
On Tue, 26 Jul 2005 09:55:37 -0400, cosmic foo sent:
I have a page with about 100 images of about 10k each.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">


I should imagine that along with what other people have already mentioned,
you'll fall afoul of the number of concurrent connections that a client
can make to a server. Servers have limits, so do the clients, and in some
cases the networking between (e.g. proxies).

What can happen is that only the first x connections succeed, and the rest
either wait longer before working, or they timeout while waiting. Then,
if someone reloads, they might go through the same thing again, *or* get
(some of) the remaining unloaded files.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.

Jul 27 '05 #6

"mbstevens" <NO***********@xmbstevensx.com> wrote in message
news:Yt****************@newsread3.news.pas.earthli nk.net...
cosmic foo wrote:
I have a page with about 100 images of about 10k each.


That's just short of a megabyte page -- huge!
Maybe 50 times the size a page should be.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">
...
I hide and show categories of images by setting a div container
display:none/block or visibility:hidden/visible.


...all of which means that anyone browsing in with javascript off
doesn't get to play. Maybe this will help:
http://www.mbstevens.com/howtothumb/
Even without seeing more of the source, what you're doing looks like
nightmare code to me -- but you should post the address so people can
look it over.


thanks for the link.
do you have javascript turned off?
how many people have javascript turned off?
Jul 27 '05 #7

"Tim" <ti*@mail.localhost.invalid> wrote in message
news:pa****************************@mail.localhost .invalid...
On Tue, 26 Jul 2005 09:55:37 -0400, cosmic foo sent:
I have a page with about 100 images of about 10k each.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">


I should imagine that along with what other people have already mentioned,
you'll fall afoul of the number of concurrent connections that a client
can make to a server. Servers have limits, so do the clients, and in some
cases the networking between (e.g. proxies).

What can happen is that only the first x connections succeed, and the rest
either wait longer before working, or they timeout while waiting. Then,
if someone reloads, they might go through the same thing again, *or* get
(some of) the remaining unloaded files.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.


thanks for the reply.
Jul 27 '05 #8
cosmic foo wrote:
"mbstevens" <NO***********@xmbstevensx.com> wrote in message
news:Yt****************@newsread3.news.pas.earthli nk.net...
cosmic foo wrote:
I have a page with about 100 images of about 10k each.


That's just short of a megabyte page -- huge!
Maybe 50 times the size a page should be.

where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">
...
I hide and show categories of images by setting a div container
display:none/block or visibility:hidden/visible.


...all of which means that anyone browsing in with javascript off
doesn't get to play. Maybe this will help:
http://www.mbstevens.com/howtothumb/
Even without seeing more of the source, what you're doing looks like
nightmare code to me -- but you should post the address so people can
look it over.

thanks for the link.
do you have javascript turned off?
how many people have javascript turned off?


More than you may imagine. People that are worried about
getting an infection often turn it off, as do people who are
just irritated by its antics, like popup windows.
People on PDAs. The text browser crowd. People behind some firewalls
(browsing while at work, for instance).

If you have
_any_
javascript navigation on a page, then you
_need_
redundant non-javascript navigation in a <noscript> section
to replace that navigation.

Don't worry, the <noscript> section will not even show up if the
visitor's javascript is turned on.

Jul 27 '05 #9

"mbstevens" <NO***********@xmbstevensx.com> wrote in message
news:I7****************@newsread1.news.pas.earthli nk.net...
cosmic foo wrote:
"mbstevens" <NO***********@xmbstevensx.com> wrote in message
news:Yt****************@newsread3.news.pas.earthli nk.net...
cosmic foo wrote:

I have a page with about 100 images of about 10k each.

That's just short of a megabyte page -- huge!
Maybe 50 times the size a page should be.
where a typical img tag looks like this,
<img src="item001.jpg" height="70" alt="" onMouseOver="showPic(this)"
border="0">
...
I hide and show categories of images by setting a div container
display:none/block or visibility:hidden/visible.

...all of which means that anyone browsing in with javascript off
doesn't get to play. Maybe this will help:
http://www.mbstevens.com/howtothumb/
Even without seeing more of the source, what you're doing looks like
nightmare code to me -- but you should post the address so people can
look it over.

thanks for the link.
do you have javascript turned off?
how many people have javascript turned off?


More than you may imagine. People that are worried about
getting an infection often turn it off, as do people who are
just irritated by its antics, like popup windows.
People on PDAs. The text browser crowd. People behind some firewalls
(browsing while at work, for instance).

If you have
_any_
javascript navigation on a page, then you
_need_
redundant non-javascript navigation in a <noscript> section
to replace that navigation.

Don't worry, the <noscript> section will not even show up if the
visitor's javascript is turned on.


thanks, i'll keep that in mind
Jul 27 '05 #10
cosmic foo wrote:
how many people have javascript turned off?


According to <http://www.thecounter.com/stats/>, 5-10% of their visitors
have JavaScript turned off.

Dave

Jul 27 '05 #11

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

Similar topics

2
by: Dave Griffiths | last post by:
Hi all Very new to JavaScript, I am trying to cache a number of images as the page loads, is there a max number of images or memory usage before the browser stops caching. My PC has 1G ram so...
1
by: Harod Ruthgar | last post by:
var image = new Image(); image.src="pathToTheFile"; The above code is called 25 times (with different pathToTheFile) within a loop. I manually checked the cache directory and not all images...
1
by: Mr. Orange | last post by:
I've found this might not really be possible to do with js, but I'm not really versed enough in it to know for sure. I have a web cam saving an image to a server, "cam.jpg". The cam replaces...
12
by: confused | last post by:
After expressing my interest in expanding my new knowledge of HTML and CSS into the wild realm of JavaScript, I was advised that it is wiser to avoid it, since not all browsers are use it or are...
4
by: et | last post by:
I have made no changes to my website, but have simply replaced images with new images of the same name, and they are part of a hyperlink. Even though I have done a rebuild over and over, it still...
3
by: wardemon | last post by:
Hi All, I have a aspx page named: ImageProcess.aspx that creates a thumbnail version of an image by passing the ImagePath, width, and height. The ImagePath is taken from a table from a database,...
2
by: CK | last post by:
Words to the wise, Henry <rcornford@raindrop.co.ukwrote: Sorry for the delay, was overly swamped and only managed to be able to free some time last week to work on this. Yes, that was the...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.