wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes Is the image downloaded many times or just once Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Is the image downloaded many times or just once" Watch "Is the image downloaded many times or just once" New topic
Author

Is the image downloaded many times or just once

Doshi Milan
Ranch Hand

Joined: May 29, 2001
Posts: 112
Hello,
In an HTML page if the same image is present at 5 places. Then will it be downloaded 5 times or is it downloaded just once and rendered 5 times.
Is it true for .js files also ?( The question of having the same .js file multiple time can be possible due to includes in JSPs ).
Thanks in advance,
regards,
Milan Doshi
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

i put off answering this because im not 100% certain, but im pretty sure the browser only downloads one file


SCJP
Visit my download page
James Hobson
Ranch Hand

Joined: Aug 28, 2001
Posts: 140
It should be that as long as the Browser can be sure the file is the same (it has the same url) it will read it from cache.
I think this means that if the same image is used on two pages, if it is referenced by a relative url it may not be read from cache.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Is the image downloaded many times or just once
 
Similar Threads
out -- in new Thread
A basic problem
Multiple includes of the same .js file.Will it slow down the application?
File structure query
javascript include issue