2

I've been writing a simple text-editor in HTML5 that is supposed to work offline. I can't, however, get the offline application cache to work, and I can't work out why not.

My manifest file is like this:

CACHE MANIFEST application.html options.html ... 

And it is being invoked as follows:

<!DOCTYPE html> <html manifest="cache.manifest"> <head> ... 

I'm using Google App Engine to host the web application.

I've put the webpage through the W3C HTML validator (http://validator.w3.org/check?uri=https%3A%2F%2Fwrite-space.appspot.com%2F) and it comes out fine.

I've tested it in Chrome and Firefox. In Chrome nothing is added to the cache storage (and window.applicationCache.status returns 0). In Firefox the notification bar asking to cache the files does not appear. Basically, the files are not being cached.

I've looked at various demos that do cache for offline viewing, and cannot work out why my code does not work.

Can anyone help?

2 Answers 2

9

To add MIME-type text/cache-manifest for .manifest files in GAE use this in your app.yaml:

- url: /static/(.*)\.manifest static_files: static/\1.manifest upload: static/(.*)\.manifest mime_type: text/cache-manifest 

This would serve all .manifest files in folder static with the correct MIME-type.

Sign up to request clarification or add additional context in comments.

Comments

6

You have to add a MIME type to .manifest:

.manifest using text/cache-manifest

In .htaccess:

AddType text/cache-manifest .manifest

1 Comment

Dunno... Maybe not ;) But that is the most common error in these cases, so, most of the time this works ;)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.