Make browsing your site a smoother experience by building a mini cache for your web pagesThis is a featured page

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:

<SCRIPTLANGUAGE="JavaScript1.1"TYPE="text/javascript">

img1=newImage();
img1.src="internet_1.gif";

img2=newImage();
img2.src="windows_1.gif";

</SCRIPT>
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.



internet-tricks
internet-tricks
Latest page update: made by internet-tricks , Sep 14 2008, 10:25 AM EDT (about this update About This Update internet-tricks Edited by internet-tricks

245 words added

view changes

- complete history)
Keyword tags: None
More Info: links to this page

Anonymous  (Get credit for your thread)


There are no threads for this page.  Be the first to start a new thread.