Supporting HTML5 manifest files on IIS 7 using Web.config

  • February 18, 2011
  • James Skemp
  • article

Having recently picked up an iPod Touch, to replace my Classic, I've become very interested in HTML5's ability to navigate content offline.

In my environment I decided to create a separate directory for my manifest files. I'm also running IIS 7, on Server 2008 R2, so .manifest files are already defined for WPF.

So that that isn't an issue, I created a Web.config file in the manifest directory with the below contents. This effectively removes the already-defined MIME type, and replaces it with the one needed for the HTML5 functionality.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <remove fileExtension=".manifest" />
            <mimeMap fileExtension=".manifest" mimeType="text/cache-manifest" />
        </staticContent>
    </system.webServer>
</configuration>

Any number of online sites can then be used to confirm that the file is passed with the correct type.