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

Qu about pre cached images

Hi.

I read an article on the web about pre caching images with javascript.

I'm doing it kind of like so:

var myImage = new Image();
myImage.src = "location/image.jpg";
I put that code into a .js file called mySite.js

Given that every page on the site has the following in the line:

<head><script LANGUAGE="JAVASCRIPT" SRC="mySite.js"></head>

Does that mean I'm forcing people's browsers to reload the same image
every time they navigate to a new page on my site?
Sep 21 '06 #1
1 1018
VK

sleem wrote:
Given that every page on the site has the following in the line:

<head><script LANGUAGE="JAVASCRIPT" SRC="mySite.js"></head>

Does that mean I'm forcing people's browsers to reload the same image
every time they navigate to a new page on my site?
No, mySite.js file is loaded only once (for the first page) and then
reused from cache.
Same with pictures: each separate picture is loaded only once and then
reused from the cache.

Note: that is for "real" .gif / .jpg / .png images. That could be some
implications if pictures are coming from an image-generating server
script and some headers are set in certain ways.

Sep 21 '06 #2

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

Similar topics

1
by: Dan | last post by:
Is there an effective way to stop pages from being cached? I've created several websites that have dynamic content and images that are managed by a client. The images are named according to the...
11
by: Michel | last post by:
Here is a litle script that preload images and show a thumbnail. Once you get on the picture you see the real size It worsk fine with normal picture but when the url has some parameters like in...
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: antishok | last post by:
Hi, I'm writing a page which has a somewhat similar folder tree to that of the windows explorer, where each folder is made of a <SPAN> tag consisting of the folder image (closed or open) and the...
21
by: Jay Levitt | last post by:
I'm just starting to play around with CSS and MovableType. My home page (http://www.jay.fm) now validates on both the CSS and the XHTML. However, the Google cached version shows the wrong font in...
3
by: Jeff Sanders | last post by:
I am running an ASP file that returns image buttons back to the client. The download on the client side is slow (about 19 small images on the page). I am running on Windows XP SP1 behind ISA...
10
by: cosmic foo | last post by:
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...
0
by: Timmay | last post by:
I'm looking for a way in vb.net 2005 to find the filename of the cached image for an image in the WebBrowser control. I can get the name of the image (ie: timmay.gif) with...
32
by: C. (http://symcbean.blogspot.com/) | last post by:
Hi all, I have an application which generates image graphs. These cache nicely at the client, however if the user submits more data, I'd like to force a reload of the image from the server. I...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.