11

I'm a developer having what should be a relatively simple problem in IIS 7 on Windows Server 2008 R2. The problem is that IIS 7 is overzealously caching all static content on the server. It's caching all .html and .js content and not noticing when the content changes on disk unless I iisreset.

I've tried the following:

  1. Deleting the local cache in my browser (I'm 99% positive this is a server caching issue)
  2. In IIS Admin in OutputCaching adding an .html extension and unchecking "User mode caching" and unchecking "Kernel-mode caching"
  3. In IIS Admin in OutputCaching adding an .html extension and checking "User mode caching" and selecting the radio for "Prevent all caching"
  4. In IIS Admin editing Output Cache Feature settings and unchecking "Enable cache" and "Enable kernel cache under OutputCaching.
  5. Running "C:\Windows\System32\inetsrv\config\appcmd set config "SharePoint - 80" -section: system.webServer/caching -enabled:false"
  6. Looking through applicationHost.config and disabling anything related to caching I could find.

Nothing seems to work. I'm getting very frustrated. Can anyone please help?

2
  • 3
    DId you manage to find a solution. I'm facing the same problem. Tried everything and I just can't disable caching. Only way is to change the filename of the file, make a request and then change back.
    – Tivie
    Nov 14, 2013 at 1:23
  • For me, not even renaming the file works. I rename the file, request the original filename, and… IIS happily returns it even though the file does not even exist. Only IIS restart helps.
    – Mormegil
    Nov 30, 2022 at 10:19

3 Answers 3

5

I would really like to see system.webServer/caching section from your applicationhost.config and web.config. Please paste them if you can. By running the above appcmd command, you have just disabled User mode caching you still have Kernel caching enabled. Also, if you really want to disable caching at the Web site or server level, just change the following:

<system.webServer>
    <caching enabled="false" enableKernelCache="false" />
</system.webServer>

You can also use Fiddler tools to verify if the content is really cached i.e. if it's returning you 304.

0

On the server, if you run 'netsh http show cache', do you see any cached entries? If so, then you have not successfully disabled Output Caching on the web server.

0

And just a $0.02 to check that your handlers are the handlers you expect them to be.

Static files are typically served by the static file handler. If you've done crazy stuff like create a wildcard script map, or register a module for all file types and verbs...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .