我正在阅读 Dive into HTML5: Offline web apps: Cache manifest
... but it must be served with the content type text/cache-manifest. If you are running an Apache-based web server, you can probably just put an AddType directive in the .htaccess file at the root of your web directory
AddType text/cache-manifest .manifest
如果我不添加这个会发生什么?内容类型有那么重要吗?我在 httpd.conf
中搜索了 AddType
。但我没有看到 content-type
表示 html
、js
、images
等。它似乎并不那么重要毕竟?
最佳答案
如果您没有正确设置内容类型,浏览器可能会拒绝将其视为 list 文件,类似于众所周知的 Firefox 问题 stylesheets get ignored if served with a plain text MIME type .
您的 Apache 服务器的内容类型可能不在 httpd.conf 中,它们通常存储在另一个配置文件 mime.types 中(默认情况下,though it can be changed)。
关于apache - HTML5 缓存 list 和内容类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3280226/