Is the classic ASP-IIS 5 to IIS 6 migration causing image caching issues?

Sorry in advance for the long question.

I'm really a database programmer, but inherited support for the classic-ASP intranet application that was recently ported from IIS 5 to a new server running IIS 6. There are about a dozen user base, all using IE 6.

The UI displays hierarchies of items returned from the database, using a combination of HTML and javascript unordered lists to hide / expand branches as the user navigates.

Images are displayed next to list members using CSS (using list style styling) using a different image for each type of element. The number of different types of items (and therefore images) in a hierarchy ranges from 2 to 10. Hierarchies range from 20 to 200 items.

Problem:

Since migrating to IIS 6, several users have experienced an issue that appears to be caused by images not being correctly applied to one or more items in the hierarchy; the list is displayed correctly, but one or more images are missing, and clicking on any link will load a blank page.

Analysis of network traffic using Wireshark and IIS logs shows that the problem is not on the server side - all content was served correctly to the client.

The issue is related to caching content on the client: it most often affects users who have not used the application on their current PC before, or have not used it for some time. Also, I can replicate the problem about one out of three attempts by starting a session, clearing the browser cache, and refreshing the page. However, the same is true for the application when running on IIS 5, so this issue may have existed prior to moving to IIS 6, but was less common. Sometimes, if I leave the session for 20 minutes or so, the browser seems to "find" the missing images and everything works fine.

If the application is accessing through a local proxy (I used Fiddler), the problem never occurs, although the Fiddler connection log shows that one or more of the connections made by the server to retrieve images have dropped. As before, the network traffic shows that the image was returned by the server. However, using a proxy seems to allow IE to find other successfully retrieved copies of the image from the cache.

I got to the point that at the end of my limited knowledge of debugging ASP / IIS problems. Removing list-style images from CSS fixes the problem, but it should be a last resort as it makes the application difficult to use.

Any suggestions on how I can proceed would be greatly appreciated.

Edit

AnonJr suggests that this must be a client configuration issue as all other components are functioning correctly.

I ditched the simple client configuration issue as this is the only application affected by the described issue. I checked all the options under Tools> Internet Options> Temporary Files> Preferences with no change in behavior.

What other client configuration options should I consider?

Edit 2 - solution

Accepted answer made me look for known issues with IE6 requesting multiple copies of the image when HTML is generated from the client side script - http://support.microsoft.com/default.aspx?scid=kb;en-us;319546 .

The article (stating this behavior is "by design") suggests bypassing pre-caching required images by loading them into an invisible DIV:

<DIV style='display:none'><IMG SRC='image.gif'></DIV>

      

This works for me - I can no longer replicate the problem by clearing the browser cache in the middle of the session, and the Fiddler trace shows that each image is only requested once.

I found one caveat that I didn't know about before; IE's cache is case sensitive, so the cached image will only be used if the case of the filename given in the invisible DIV matches what is used elsewhere on the page.

+1


source to share


2 answers


This brings IE6 bug where the browser makes multiple requests for the same resource. For example, if the content causes a small icon to be displayed 20 times in the list, instead of just fetching that image once, it tries to fetch it 20 times. OK 19 replies: 304 Not Modified, but 19 additional rounds per server.

I found this excessive request in the past, after all, you ended up with too many unfulfilled requests. At this point, further requests to the server even for other pages try to get a response, at least for a while.

I'm not sure if this is what's going on in your case, one way to look into this is to use IE7 instead to see if you have the same problem, this bug has been fixed in IE7.



Edit . Now that the issue has been confirmed as the bug I was linking to, you should also mark the KB link for "short delay". The main problem is that in order to reuse a recently loaded image, the browser has to do work that is delayed until the current chunk of javascript is finished. Shorter latency required, asynchronous approach needed.

I used display: no DIV approach to prefetching images and this works well for AJAX style work. However, if you have code running during or before a window's onload event, you will still have a problem adding images to that code. SetTimeout is required to complete the following code after the onload event has finished.

+1


source


You can focus on customizing your client-side caching settings. If the images are sent by the server, then this is unlikely to be an IIS problem. If the HTML for the images is being sent to the browser, this is not an ASP issue. This leaves the client behind.



A proxy can mitigate some of the issues and / or it could be a factor in how IE6 decides to cache images, etc.

0


source







All Articles