HTML5 Application Cache and Azure websites

Today I faced any issue with HTML5 Application Cache (I will post about HTML5 Application Cache later), I deployed an HTML5 application to azure website, but I was getting error like this

Application Cache Error event: Manifest fetch failed (404)

Application Cache Error event: Manifest fetch failed (404)

This issue was due to the MIME type mapping was missing. Since it is website, developers don’t have direct control over the IIS. Here is the fix, using Web.Config file.

<system.webServer>
  <staticContent>
    <remove fileExtension=".appcache" />
    <mimeMap fileExtension=".appcache" 
              mimeType="text/cache-manifest" />
  </staticContent>
</system.webServer>

Sometimes we will get this issue while running in IIS Express as well.

Happy Programming :)