View Full Version : Will 'Pre-Load Images' in header file called on EACH page drive up bandwidth?
techwannabe
10-24-2005, 05:31 PM
Hello.
Will 'Pre-Load Images' in header file (e.g. $header) called on EACH page drive up bandwidth?
For example, if the images pre-loaded (200 kb) is called in a header file that is called for all pages, say 30 pages, will this use 6 MB of bandwidth OR does the browser's cache check to see if cached graphics are the most recent modified date and not increase bandwidth?
Thanks in advance.
If they are preloaded and CALLED from proper locations there shouldnt be any problem..
IF they must be laoded, EVEN if they are encoded, its DATA, it must be loaded to display and that will cause Bandwith increase.
techwannabe
10-24-2005, 05:49 PM
Thanks for your reply.
I don't fully understand.
What do you mean by 'If ...CALLED from proper locations' AND 'IF they must be loaded, EVEN if they are encoded, its DATA, it must be loaded to display and that will cause Bandwith increase.'
Can you give me an example of an improper location AND under what condition when it's considered 'data'.
Thanks again.
OK,
PRE-LOADEd means that the system calling has already loaded the images.
So, they are lacated on the other system...
ALL you need to do is call them up, they are generally on internet, in a temp file.
C:\internet\temp
MOSTLY sites load the graphics on the first page, and from then, each time they call it, its ALREADY on there system.
As a GAME loader..
Lets look at Half life...
If (you check the DIR) c:\steam\halflife\counterstrike\map.bsp =TRUE
LOAD it.. Play game..
IF (SAME) is False then send DATA, to load into DIR.
So, if you are useing the same pic on each page, they only have to be 1 OF the pic, and then loaded fron LOCATION each time...
I dont know about your programing, BUT...
we used to make a statement equal to what was needed...
PIC1="c:\this\that\theotherthing\Pic1"
then do a call for the PIC1...
IF PIC1 is on system, load it.
IF PIC1 isnt on system...SEND it..
or..each time you wanted PIC1..
insert the deffinition...PIC1...which calls the location and loads it.
techwannabe
10-24-2005, 06:51 PM
I think I've got it. This is for a basic website.
Since the $header var is called for each '.php' file, and that $header var contains a call to the pre-load '.js' file, I just wanted to be sure whether or not to use the pre-load feature. Since it was being called up for each '.php' file, I didn't want to save on image loading time at the expense of driving up the bandwidth.
So, if I understand you correctly, once the local machine has pre-loaded the images, even though each subsequent time the $header var with the pre-load script is called for the other '.php' files, the bandwidth won't be increased again since the images are already stored on the local PC's internet temp file unless the images' 'last modified date' is changed.
Thanks again.
You are getting the idea...
as long as the temp dir isnt DUMPED, or something with the same name is loaded over it...you are COOL...other wise the data must be reloaded.
techwannabe
10-24-2005, 07:09 PM
Thank you so very much. You're so helpful.
You might be confused on what you pre-load the images on.
I would recommend only pre-loading small images that are used in some dynamic way, like menu buttons. For example, if you have 2 different styles for a menu button: an image for hover and an image for non-hover, you want to pre-load the hover image so that when someone does mouse over it, it doesnt take time to download. It's rather annoying to mouse over a menu item and have the menu button disappear while the mouse over graphic loads.
As for caching in a browser, you can't really control how people setup their browsers. It wont matter if an image is set to pre-load or not.
For example:
1) if someone has their browser set to cache everything and not check for new versions, it will always use whats in the cache. In this instance, your pre-load shouldnt matter after they have visited your page once, since the browser will check the cache and see if it has the same graphic file already. If it does, it wont download from your site.
2) if someone has their browser set to not cache at all, your pre-load will kick in on every page they view
3) if someone has their browser set to only download changed items, your pre-load should only kick in once: the first time they visit each page. After that, it should load from cache only.
Since pre-load should only be used in moderation, for dynamic images (images that change due to user interaction) the bandwidth should be minimal anyways.
The size should be minimal anyway..
you only need 75-100dpi pics, MAX.. And jpg, is so small, this isnt even 1k.
Only time it MIGHT take abit of time is a LARGE pic, or on a phone modem.
But even if both happen. and you have a PAGE full of Icons, it would take less then 1-2 min..
techwannabe
10-26-2005, 03:48 PM
Thanks to you both. I have a much better understanding now.
Take care.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.