Re: Web App Image Caching




Giggle Girl wrote:
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.

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.

.



Relevant Pages

  • Re: ext3/ext4 directories dont shrink after deleting lots of files
    ... So to fix this we need to actually coalesce directory leaf blocks on ... But once they are in cache, it's no longer a major problem. ... time the first time you pull their directory entry into the cache. ... What sort of performance degredation are you measuring, ...
    (Linux-Kernel)
  • Re: Delay in Web Browsing
    ... you even picked up on cache size. ... > annoying delay when I click on a desktop icon to bring up a web page. ... > Spyware Guard, Spyware Blaster as well as IE-Spyad. ... I regularly remove TIF files, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Favicons speichern nicht mehr im Cache
    ... detailliert wie möglich beantworten. ... > Wenn ich den Cache lösche, dann ist er ganz leer, keine Dateien mehr da. ... Direkt nach dem Schließen der ersten Instanz ist das Icon noch da, ...
    (microsoft.public.de.german.inetexplorer.ie6)
  • Re: [PATCH/RFC] Simplified Readahead
    ... Right the first time the next_size is decremented ... >since the pages are already in the page cache the next_size keeps incrementing. ... >>in the page cache the readahead turns off. ... What I do now for page cache hits is count how many pages in a row are ...
    (Linux-Kernel)
  • Re: ICON CONFUSION: Buy It Now Icon versus Buy It Now with BEST OFFER
    ... some of my auctions have been Fixed Price auctions with Best ... PRICE icon...NOT...the FIXED PRICE with BEST OFFER icon. ... this much a cache problem. ... could be the cause of why, if eBay happened to change an icon, and I ...
    (alt.marketing.online.ebay)