Eric,
We have checked several options on our own commercial products We feature an interface with a lot of generated dom; treeviews, menu systems, grids, so we had to investigate this further to review possible workarounds.
What we noticed:
Without a one day expiration header in IIS
Every visit to the page
Current behavior:
For each image, the image is retrieved from the server and not from the cache.
Expected behavior:
The image is retrieved only once, transferred to the cache and then every request for the same file returns the cached version.
Automatically
Current behavior:
The image is retrieved only once, then the cached version is shown for every new request on that file. Every image however does fire a 304 (is modified) header.
Expected behavior:
The image is retrieved only once, then the cached version is shown. New requests do not fire a 304 to the server. Only the first request for that file requires a modified check. T
With a one day expiration header in IIS
Every visit to the page
Current behavior:
The image is retrieved only once, then the cached version is shown. It does not fire a 304 request for other requests, because the header tells the browser it is safe to use the cached version for one day.
Expected behavior:
Current behavior.
Automatically
Current behavior:
The image is retrieved when not available in cache, then the cached version is shown for every new request on that file. It does not fire a 304 request for other requests, because the header tells the browser it is safe to use the cached version for one day.
Expected behavior:
Current behavior.
So the situation with the expiration header is ideal. The 304 requests being fired without the expiration header are not necessary. The chances someone might change one of the 200 identical images in the current page load are almost zero. Only the first request should check.
Links to examples showing the behavior:
The treeview of Erik Arvidsson:
You see this very good at components which have been build up with a lot if visuals. You see this very good, when you set cache to “every visit to the page”. Sometimes the browser just hangs, this is a known issue with this treeview because it leverages a lot of images to create the indent effect of the treeview.
http://webfx.eae.net/dhtml/xloadtree/demo.html
My current hobby project:
Load the page, and in the top click the “thumbnail view” link. All images are loaded despite cache settings being set on automatically.
http://www.mschopman.demon.nl/grid/
And a treeview project
Enable “every visit to the page” and notice how each identical file is reloaded.
http://www.mschopman.demon.nl/treeview_v1.6.5/treeview.html
References to real problems this behavior causes (crash/hang/unresponsive/etc.):
http://support.microsoft....spx?scid=kb;EN-US;q269802
http://support.microsoft....aspx?scid=kb;en-us;183110
http://support.microsoft....aspx?scid=kb;en-us;319546
And we did some testing ourselves in a load testing environment with IBM Page Detailer.
Without expiration header:
Automatically: 110-120 items are loaded
Every visit to the page: 530-560 items are loaded
With expiration header:
Automatically: 10-20 items are loaded
Every visit to the page: 60-80 items are loaded
Also when you for example; change background images on elements with hover, the background images are being reloaded despite cache settings.
If you need more information, please tell. We would be glad to be of any assistance, testing, etc. Web interfaces will become more and more complex, and we expect a lot will be generated in future with Javascript (is there any change on the Javascript garbage collector btw for JS-Dom refs?) . So I think these issues are becoming more and more important.