Connecting Tech Pros Worldwide Help | Site Map

Web App Image Caching

 
LinkBack Thread Tools Search this Thread
  #1  
Old February 9th, 2006, 01:45 PM
Giggle Girl
Guest
 
Posts: n/a
Default Web App Image Caching

Hello,
I am helping to design a web application that uses 167 little icons on
various pages in a framed environment. As is, the app loads each icon
on a page by page basis, and if an image changes (like a "plus" becomes
a "minus" when a folder icon is expanded) is does a

document.all[img].src="picsV/minus.gif"

which I am pretty sure goes and grabs the image at that moment, making
no use of caching images at all.

QUESTIONS

1. Does it make sense to use javascript to do a

var Icon_Minus = new Image
Icon_Minus.src = "picsV/minus.gif"

in the main frameset for each of the icons that change (which is about
50), so I will have all changeable icons cached for quick display on
each page when they change?

2. Can you "flip" images in sub-frames that were cached in a parent?

Thanks,
Ann


  #2  
Old February 9th, 2006, 02:35 PM
VK
Guest
 
Posts: n/a
Default Re: Web App Image Caching


Giggle Girl wrote:[color=blue]
> Hello,
> I am helping to design a web application that uses 167 little icons on
> various pages in a framed environment. As is, the app loads each icon
> on a page by page basis, and if an image changes (like a "plus" becomes
> a "minus" when a folder icon is expanded) is does a
>
> document.all[img].src="picsV/minus.gif"
>
> which I am pretty sure goes and grabs the image at that moment, making
> no use of caching images at all.[/color]

You have a wrong idea of how the browser cach is working.

Say you have an image "http://www.myserver.com/pics/minus.gif" This
image has to be retrieved at least once from the server: and it is
retrieved once the first time the image is displayed or initialize over
Image object. Ever after your browser will take the image from the
cache w/o extra loading from the server.

You don't need to worry about caching, just opposite you need to take
extra steps to *not* cache an image (by say randomizing its URL).

The traditional image precaching:
var iOver = new Image();
iOver.src = 'http://www.myserver.com/pics/foo.gif';
doesn't affect on the cache behavior. It is used to avoid the *initial*
delay when say foo.gif is requested for the first time. After the first
usage (so the image was cached) there is absolutely no difference
whether you precached that image or not: it will be still taken from
the local cache with the same speed.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.