I am currently working on a site using Asp.net and IIS 7.5. I have configured IIS using the following:
<caching>
<profiles>
<add extension=".jpg" policy="CacheUntil开发者_如何学运维Change" kernelCachePolicy="CacheUntilChange" />
<add extension=".gif" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".swf" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".txt" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
<add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" />
</profiles>
</caching>
Firefox and Chrome are reporting that they are getting the cacheable files from the local cache. However I was using HttpWatchStudio, screen below, to monitor IE 8 and noticed that the output report indicated that the files served off my IIS server were not cached. The cached files in question in the image are from google.
Is there a method to double check that IE is in fact caching the files? Should I just check the Temp Internet folder on my local machine?
Probably the most sure-fire way to check is to fire up Wireshark or a similar packet caturing program and see what request the browser is making to the server.
I updated the my caching profile then inspected the traffic again. The content was now being cached locally in IE.
<caching>
<profiles>
<add extension=".txt" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client" />
<add extension=".swf" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client" />
<add extension=".gif" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client" />
<add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client" />
<add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client" />
<add extension=".css" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client" />
<add extension=".js" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Client" />
</profiles>
</caching>
精彩评论