HTML5: Why I need to add manifest file to .htaccess?
I have seen some articles about HTML5 Manifest, which say that we must add manifest file to .htaccess with following l开发者_运维问答ine:
AddType text/cache-manifest .manifest
However, there is no any explnation what is the purpose of adding? Where should I place this .htaccess file ? in the same folder where the manifest file is? and finally how can i make sure that it is added to .htaccess successfully?
Even if i do not create any .htaccess file, i only add this to my html file
<html manifest="site.manifest">
I can see the popup bar in firefox, asking that the website is asking to store data. So isn't it working without this .htaccess? I'll appriciate if anyone can explain. Thanks.
You don't "add a manifest file" to .htaccess with that line. That line just tells Apache that files with the suffix ".manifest" will be of type text/cache-manifest
. Apache tells the client about the file type in the HTTP content-type
header. The HTTP content-type
header is required for the browser/client to understand how to interpret the contents of the file. Refer:
- AddType Directive @ httpd.apache.org
- The cache manifest in HTML5 @ en.wikipedia.org
- The cache manifest syntax @ w3.org
- Offline Web Applications @ w3.org
精彩评论