我在windows角色中托管了一个mvc3 web应用程序,并且最近添加了html5现金清单。
在本地环境中,一切都运行良好,但是一旦上传到azure上的dev环境,我在尝试访问清单时会收到一个HTTP 500错误。
缓存清单文件由操作和控制器提供,类似于休谟院长的文章中描述的技术。
控制器:
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/Offlinethe _Layout:
<html manifest="@Url.Action("Manifest","Home")">错误消息:来自铬控制台的:“应用程序缓存错误事件:清单获取失败(500)”
从小提琴手:
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我想要点帮助。
发布于 2012-03-29 14:43:59
问题可能是IIS缺少Azure中的MIME类型。看一看:
http://blog.christian-heindel.de/2011/10/23/how-to-host-html5-offline-web-applications-on-an-iis-web-server/
但是,请记住,对于Azure,您必须在启动任务或WebRole OnStart方法中执行此操作,以便在实例启动时发生任何事情。
https://stackoverflow.com/questions/9923167
复制相似问题