HTML5 Application Cache and Azure websites

March 06, 2015 by Anuraj

.Net .Net 4.0 ASP.Net MVC Visual Studio

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 :)

Copyright © 2024 Anuraj. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Powered by Jekyll. Hosted with ❤ by GitHub