IIS: How to Disable Caching of Specific MIME Types

Published by

Posted on December 20, 2008

MIME stands for “Multipurpose Internet Mail Extensions,” which refers to a way of configuring browsers or mail clients to view files that are in multiple formats based on a “MIME type.” “MIME mapping” is a process by which Internet Information Server (IIS) “maps” files by their extensions to a particular MIME type. For example, a file with the extension .htm has a MIME type of “text/html”, whereas a file with the extension .gif has a MIME Type of “image/gif”.

When a request is made by a client for a particular file, IIS uses the MIME map to determine the correct MIME type to tell a client it will be receiving. IIS contains a large list of default MIME types to use and will return a MIME type of “application/octet-stream” for any file extension that is not explicitly mapped.
Cache Disabling Techniques
The easiest way to disable caching of a given MIME type is to create folders based on the types to disable and then set custom headers for those folders. For example, the following steps will disable caching of files in an images folder:

Create a folder under your Wwwroot folder named Images.
Open the Internet Services Manager (ISM).
Locate the Images folder under your default Web site.
Right-click the Images folder and select Properties.
Select the HTTP Headers tab.
Click Add in the Custom HTTP Headers section.
Add a header named Cache-Control with a value of no-cache.
Click ok to apply the changes.

Reference M$ KB 247389