Take the 2-minute tour ×

I started to use HTML5 cache to view a simple HTML page with one css file and two js files.

My problem is that the cache is used whether I'm offline or not. But I just want to use the cache when I'm offline. Does anyone know how to solve this?

index.html file manifest:

<html manifest="app.cache">

app.cache manifest file:


Thank you!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

manifest="app.cache" - not going to solve your problem. It caches all the file listed in manifest file. You have to save your data in local storage or in local db and have to retrieve data from server/local based on connection status [online/offline].

share|improve this answer

According to the standard as given at whatwg, this is possible by changing the cache mode from the default fast to the prefer-online state. There, the instructions given are to add the following at the end of your appcache manifest, after listing all the files you need available offline:


Apparently the idea behind this is to allow adding basic offline support to "legacy" applications that cannot help having to change the html document everytime it is served. I have not verified that this works in any current browser.

share|improve this answer

Your Answer


