【问题标题】:HTML5 Cache Manifest and Content typesHTML5 缓存清单和内容类型
【发布时间】:2011-03-17 20:26:00
【问题描述】:

我正在阅读Dive into HTML5: Offline web apps: Cache manifest

...但它必须与 内容类型文本/缓存清单。如果 你正在运行一个基于 Apache 的网络 服务器,你可以只放一个 .htaccess 中的 AddType 指令 Web 目录根目录下的文件

AddType text/cache-manifest .manifest

如果我不添加这个会发生什么?内容类型这么重要吗?我在httpd.conf 中搜索了AddType。但我没有看到content-typehtmljsimages 等等。毕竟它似乎并不那么重要?

【问题讨论】:

    标签: apache http html content-type


    【解决方案1】:

    如果您没有正确设置内容类型,浏览器可能会拒绝将其视为清单文件,类似于众所周知的 Firefox 问题stylesheets get ignored if served with a plain text MIME type

    您的 Apache 服务器的内容类型可能不在 httpd.conf 中,它们通常存储在另一个配置文件 mime.types 中(默认为though it can be changed)。

    【讨论】:

    • 我直接将我的添加到 httpd.conf。您也可以将其添加到本地 web 目录中的 .htaccess 文件中。
    猜你喜欢
    • 2010-09-21
    • 1970-01-01
    • 2012-07-01
    • 1970-01-01
    • 2012-02-20
    • 2012-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多