Application cache not working when running application in localhost?

I have an html file with a manifest.

<!DOCTYPE html>
<html manifest="manifest.appcache" type="text/cache-manifest">
<head>
    <title>Sample</title>
</head>
<body>
   Sample app
</body>
</html>

and manifest file as follows:

CACHE MANIFEST
*

usually firefox should offer me to store files in chache browser?

it doesn't prompt, and nothing caches when I look in dom using the Firebug DOM tab.

Can someone tell me what is going on here, or am I missing something?

+4
source share
1 answer

The manifest file must be processed with the special mime type text/cache-manifest. If the browser does not consider the manifest file, it is not taken into account. Therefore, you are better off setting up a local http server and setting up the correct mime type. For apache you can add this to your .htaccess

AddType     text/cache-manifest     .manifest

:

+2

All Articles