【问题标题】:AppCache Fatal ErrorAppCache 致命错误
【发布时间】:2014-04-06 15:10:09
【问题描述】:

Appcache 在 Chrome 中完美运行,但是在 IE(11) 中我得到一个非常模糊的“AppCache 致命错误”。

我的语法如下:

CACHE MANIFEST

# 2014 03 04 Verson 1.0.4 #
###########################

/resource.php

NETWORK:
*

FALLBACK:

_

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" manifest='<?php echo DOMAIN; ?>/appcache/text/cache-manifest/manifest.appcache' type='text/cache-manifest'>

编辑:我认为这与大小无关。我清空了清单中的所有资源,所以这只是部分和版本,我仍然收到错误。

编辑 2:我在 Safari 中尝试过,并在控制台日志中收到以下内容:

Application Cache manifest had an incorrect MIME type: text/plain.

所以,我猜我的 MIME 类型是错误的;我该如何解决这个问题?

【问题讨论】:

    标签: internet-explorer manifest mime-types html5-appcache application-cache


    【解决方案1】:

    除了 squid314 写的内容之外,我注意到当您使用 cookie 时 appCache 将在 IE 10/11 和 FF 中中断。但它适用于 Chrome。

    例子:

    <?php
    // usually creates PHPSESSION cookie which will break the appCache for IE and FF
    session_start() 
    ?>
    

    【讨论】:

      【解决方案2】:

      配置 MIME 类型将取决于您使用的服务器。 (请注意,&lt;html&gt; 标签上的 type='text/cache-manifest' 没有任何作用。)如果您使用的是 Apache,您应该可以添加

      AddType text/cache-manifest .appcache
      

      .htaccess 文件或服务器配置(httpd.confapache.conf 或其他)。见here。如果您使用不同的 Web 服务器,应该可以使用类似的配置文档。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-05-27
        • 2016-04-24
        • 1970-01-01
        • 2014-07-22
        • 1970-01-01
        • 1970-01-01
        • 2012-05-13
        • 2012-08-15
        相关资源
        最近更新 更多