提前道歉,问题有些冗长。
我真正是一位数据库程序员,但我继承了对一个Classic-ASP Intranet应用程序的支持,该应用程序最近已经从IIS 5迁移到了运行IIS 6的新服务器。用户基础约为十几个,全部使用IE 6。
用户界面显示来自数据库的项目层次结构,使用HTML无序列表和JavaScript的组合,在用户浏览时隐藏/展开分支。
使用CSS(使用list-style-image)将图像显示在列表成员旁边,每种类型的项目使用不同的图像。层次结构中不同项目类型(因此图像)的数量在2到10之间变化。层次结构在20到200个项目之间变化。
The problem:
自迁移到IIS 6以来,几个用户发现一个问题,可能是由于一些图像未能正确应用到层次结构中的一个或多个项目引起的;列表显示正确,但一个或多个图像丢失,点击任何链接会导致加载空白页。
使用Wireshark和IIS日志分析网络流量显示问题不在服务器端 - 所有内容都已正确提供给客户端。
The issue appears to be related to content caching at the client: it seems to more often affect users who have not used the application before on their current PC, or have not used it for some time. Also, I can replicate the issue approximately one attempt in three by starting a session, clearing my browser cache and then refreshing the page. However, the same is true of the application when running on IIS 5, so this issue may have existed before the migration to IIS 6 but have happened less frequently. Occasionally, if I leave the session for 20 minutes or so, the browser seems to "find" the missing images, and everything works OK.
If the application is accessed through a local proxy (I used Fiddler) the problem never occurs, although the Fiddler connection log shows one or more connections made to the server to retrieve the images has aborted. As before, network traffic shows that the image was returned by the server. However, using the proxy seems to enable IE to find other successfully retrieved copies of the image from the cache.
I ve reached the point where I m at the end of my limited knowledge of debugging ASP/IIS issues. Removing the list-style-images from the CSS fixes the problem, but this has to be the option of last resort since it makes the application more difficult to use.
Any suggestions on how I can proceed would be gratefully received.
编辑
AnonJr建议这可能是客户端配置问题,因为所有其他组件似乎都在正常运作。
I discounted a simple client configuration issue because this is the only application affected by the issue described I have tested all the options under Tools > Internet Options > Temporary Files > Settings with no change in behaviour.
What other client configuration options should I be considering?
编辑2-解决方案 (Biānjí 2- jiějué fāng'àn)
接受的答案促使我搜索IE6的已知问题,即在从客户端脚本生成HTML时请求多个图像副本- http://support.microsoft.com/default.aspx?scid=kb;en-us;319546。
这篇文章(指出这种行为是“按设计操作”)建议通过将所需图像加载到不可见的DIV中进行预加载来解决问题。
<DIV style= display:none ><IMG SRC= image.gif ></DIV>
这似乎对我有效-我无法通过在会话中清除我的浏览器缓存来再现问题,而 Fiddler 追踪显示每个图像仅被请求一次。
我发现了一个以前不知道的警告; IE缓存是大小写敏感的,因此只有当隐形DIV中指定的文件名的大小写与页面中其他地方使用的匹配时,才会使用缓存的图像。