【问题标题】:HTML 5 Manifest has different behavior across multiple browsersHTML 5 Manifest 在多个浏览器中具有不同的行为
【发布时间】:2013-09-23 16:48:08
【问题描述】:

我在我的 HTML 5 Manifest 中添加了一些设置,这些设置在 Google Chrome 和

上产生了完美的行为

iOS 上的 Safari 和 iOS 上作为网络剪辑的 Safari。

不幸的是,相同的代码导致在 IE 和 Fire Fox 中加载清单文件时中止。

这是我们应用的设置:

在服务器端:IIS 7、Windows Server 2008 R2。 响应: text/cache-manifest ,无缓存。

清单的文本是:

CACHE MANIFEST


CACHE:

/
/Index.html
/Login.html
/favicon.ico
/Content/Kendo/web/Font/FontAwesome.otf

NETWORK:
*

这是第一个文件的 IE 网络分析器的结果

URL: http://192.168.0.220:1009/

Method:

Result: (Aborted)

Type: text/html

Received: 292 B

Taken: < 1 ms

Initiator: (Pending...)

下面是回复:

Key Value

Response    HTTP/1.1 200 OK

Cache-Control   no-cache, no-store

Pragma  no-cache

Content-Type    text/html

Expires -1

Last-Modified   Mon, 23 Sep 2013 16:05:06 GMT

Accept-Ranges   bytes

ETag    "351169ab76b8ce1:0"

Server  Microsoft-IIS/7.5

X-Powered-By    ASP.NET

Date    Mon, 23 Sep 2013 16:32:43 GMT

这是 html 5 manifest 的错误信息:

Resource doesn’t exist on the server: 'http://192.168.0.220:1009/'. 
AppCache Fatal Error

最后我在 Index.html 页面上有了这些元标记:

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE" />
<meta http-equiv="EXPIRES" content="0" />
<meta http-equiv="PRAGMA" content="NO-CACHE" />

非常感谢任何帮助。

【问题讨论】:

    标签: asp.net html internet-explorer firefox manifest


    【解决方案1】:

    我找到了问题的原因。

    我们应该在 ASP.NET Global.asax 的 Request_End 中应用

    HttpContext.Current.Response.Cache.SetNoStore();
    

    仅适用于 iOS,chrome 始终有效,无论是更新应用程序还是离线使用。

    注意:iOS 的 web clip 和 safari 需要 no-store,因为文件在更新 manifest 之前已经加载,否则即使 manifest 下载新版本也不会更新其中。

    希望这对你也有帮助。

    【讨论】:

      猜你喜欢
      • 2011-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多