0
votes

i'm hosting an mvc3 web application in a windows azure web-role , and have recently added the html5 cash manifest.

in local environment everything works well , but once uploaded to dev environment on azure , i'm getting an HTTP 500 error when trying to access the manifest.

the cache manifest file is being served by an action and controller , similar to the technique sescribed in Dean Hume's article

the controller:

    public ActionResult Manifest()
    {
        Response.ContentType = "text/cache-manifest";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.Cache.SetCacheability( System.Web.HttpCacheability.NoCache);
        return View();
    }

the View:

    @{
Response.ContentType = "text/cache-manifest";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
Layout = null;

}

    CACHE MANIFEST 
    # 29/3/2012:V6
    NETWORK:
       * 
    CACHE: 
     #JS FILES
    /Scripts/rolllo_1.0.js
    /Scripts/rolllo_1.0.js
    /Scripts/jquery.mobile-1.0b3.min.js
    /Scripts/jquery.validate.min.js
    /Scripts/jquery.validate.unobtrusive.min.js
    /Scripts/jquery.unobtrusive-ajax.min.js
    /Scripts/rolllo_1.0.js

    #CSS FILES 
    /Content/Rtl.css
    /Content/JQM/jquery.mobile-1.0b3.css
    /Content/Site.css?v=2" 


    FALLBACK:
    /Group/Offline

the _Layout:

    <html manifest="@Url.Action("Manifest","Home")">

error messages: from the chrome console : 'Application Cache Error event: Manifest fetch failed (500)'

and from fiddler :

    HTTP/1.1 500 Internal Server Error
    Cache-Control: no-cache
    Pragma: no-cache
    Content-Type: text/cache-manifest; charset=utf-8
    Expires: -1
    Date: Thu, 29 Mar 2012 09:32:22 GMT
    Content-Length: 5875

i'd love some help.

1

1 Answers

1
votes

The problem is probably that IIS is missing the MIME type in Azure. Take a look at:

http://blog.christian-heindel.de/2011/10/23/how-to-host-html5-offline-web-applications-on-an-iis-web-server/

But keep in mind for Azure you will have to do this in a startup task or in the WebRole OnStart method so it will happen anything your instance starts up.