(page requirements)

Make browsing your site a smoother experience by building a mini cache for your web pages

If you have multiple pages with many images (and other multimedia files), you can make browsing your site a smoother experience for your visitors by building a mini cache for your site. Sure, all major web browsers have their own caching system. However, all of them cache files after you see or hear them at least once, which of course does not give the optimum performance during the first visit to a page. Our mini cache on the other hand will try to load the necessary files before visitors see or hear them for the first time, significantly improving the response time.
The trick is to pre-load most widely used images at your site.
For example, let's say a visitor is at your home page -- "index.html" -- where he/she would spend some time reading your welcome message. Then let's assume that the next page (named "welcome2.html" for example) he/she would go to may contain two images called "internet_1.gif" and "windows_1.gif" Why not load those two images in the background while your visitor is looking at your home page? For this particular example, let's use JavaScript to do the pre-loading of images:
<SCRIPT LANGUAGE="JavaScript1.1" TYPE="text/javascript">

  img1 = new Image();
  img1.src = "internet_1.gif";

  img2 = new Image();
  img2.src = "windows_1.gif";

Listing #1 : JavaScript code. Download preload.htm (0.25 KB).
Simply paste the above tags on to the first page -- "index.html". That's it -- necessary images for "welcome2.html" page will be cached before visitors would get there, so the loading of that page would be much smoother.
Applicable Keywords : HTML, Internet Explorer, Explorer 4.x, Explorer 5.x, Internet, JavaScript, JavaScript 1.1, JavaScript 1.2, Netscape Navigator, Navigator 3.x, Communicator 4.x, Netscape 6.x, World Wide Web
Copyright © 2009 Chami.com. All Rights Reserved. | Advertise | Created in HTML Kit editor