# Disable static content caching in IIS 7

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.

-
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 '13 at 1:23

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.

-

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.

-

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...

-