Shreedhar
Shreedhar

Reputation: 5640

App cache is not working when running an application in localhost?

I have a html file with manifest defined.

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

and a manifest file like this:

CACHE MANIFEST
*

usually, firefox should prompt me to store the files in the browser chache?

its not prompting and also nothing is getting cached, when i look into the dom, using firebug's DOM tab.

Can anybody tell me what is happening here or am i missing something?

Upvotes: 4

Views: 1569

Answers (1)

Ortomala Lokni
Ortomala Lokni

Reputation: 62466

The manifest file must be served up with the special mime-type text/cache-manifest. If not the browser will probably not take the manifest file into account. So you better set up a local http server and configure the right mime type. For apache you can add this to your .htaccess

AddType     text/cache-manifest     .manifest

Read the following article for more details: Testing Your Offline Applications

Upvotes: 2

Related Questions