# IIS7禁用单个静态文件的缓存配置方法

IIS7中，想将一个经常修改的静态文件设置为不可缓存，在IIS配置界面里怎么也找不到...

 just stumbled across this question; you can use the following to disable the cache on a specific file:

<configuration>
<location path="path/to/the/file">
<system.webServer>
<staticContent>
<clientCache cacheControlMode="DisableCache" />
</staticContent>
</system.webServer>
</location>
</configuration>
(Note that the path is relative to the web.config file)

Alternatively, place the single file in a directory on it's own, and give that directory it's own web.config that disables caching for everything in it;

<configuration>
<system.webServer>
<httpProtocol>
[Both tested on IIS7.5 on Windows 7, but you'll have to confirm that it works OK on Azure]