How do I force IIS 7 to not cache images on a certain page?
I don't think the IIS web server is the one caching pages - it's the client's browser.
You can add a meta tag to the pages you don't want the client side to cache, and there are ways to do this for different older browsers and such.
If you write in ASP and want the same non-cache effect, here's the header information.
The thing you are looking for is cache-control header value (note that this only works for browsers that respect http 1.1)
For asp the code is:
You can also set this directly on a folder using the metabase:
Here's how you would set the folder pix on the default website: Open a command prompt and change to your C:\InetPub\AdminScripts folder. Run the following command: CSCRIPT ADSUTIL.VBS SET W3SVC/1/ROOT/pix/CacheControlCustom "no-cache"
Note the possible values are "no-cache" , "Public", "Private"
Yo can also set this via ADSI:
So far these approaches will work on IIS6 and IIS7 so long as you have the IIS6 admin tools installed. For a pure IIS7 environment here are the appcmd commands:
First unlock the config section
Now you're good to change the caching options for static content. Make static content non-cacheable by setting "Cache-Control: no-cache":