HTML5缓存清单和内容类型 [英] HTML5 Cache Manifest and Content types

查看:173
本文介绍了HTML5缓存清单和内容类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读潜入HTML5:离线Web应用程序:缓存清单

...但它必须与送达
  内容类型文本/缓存清单。如果
  您正在运行一个基于Apache的Web
  服务器,你可能只是把一个
  在.htaccess AddType指令
  请通过你的web目录的根目录

... 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文本/缓存清单
  名为.manifest

如果我不添加此会发生什么?是内容类型如此重要?我的确在的httpd.conf 将AddType 搜索。但我没有看到内容类型的发言权 HTML JS 图片等,这似乎不那么重要毕竟?

if i dont add this what will happen? is the content type so important? i did a search for AddType in httpd.conf. but i dont see content-type for say html, js, images etc. it dont seem all that important after all?

推荐答案

这可能是因为,如果你不具备的内容类型正确设置浏览器将拒绝把它当作一个清单文件,类似于著名的Firefox的问题其中,<一个href=\"https://developer.mozilla.org/en/Mozilla_Web_Developer_FAQ#My_style_sheet_doesn.e2.80.99t_work!_Why.3f\"相对=nofollow>样式表都被忽略,如果使用纯文本MIME类型服务。

It's likely that if you don't have the content type set correctly the browsers will refuse to treat it as a manifest file, similar to the well known Firefox problem where stylesheets get ignored if served with a plain text MIME type.

的内容类型Apache服务器都可能无法在httpd.conf,他们通常都存储在其他配置文件的mime.types(默认情况下,的虽然它可以改变)。

The content types of your Apache server are possibly not in httpd.conf, they are usually stored in another configuration file mime.types (by default, though it can be changed).

这篇关于HTML5缓存清单和内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆