[html5] Offline apps

Shwetank Dixit shwetankd at opera.com
Sat Apr 9 13:41:50 PDT 2011


Hi,

A more proper name is 'application cache' or 'appcache' which gives you an  
idea that its more designed for web apps than simple web pages.

One possible solution could be that you include the various js, css and  
images used in the pages in the appcache, but not the actual page itself.  
And then have a fallback page in case you're offline using the 'fallback'  
section header.

so in other words something like this

CACHE MANIFEST

script.js
style.css
image.png

FALLBACK:
index.htm fallback.htm

Another more simple way would be to simply update the manifest file which  
will force browsers to update the appcache. However, if your page is  
dynamic and you're supposed to get a different page everytime, then maybe  
its not the best way to go about it.

Another way could be to store your list locally using localStorage or  
other techniques. load it from there, and using ajax, update it from the  
server if you can connect.

shameless plug, but maybe the article ive written here can help  
http://dev.opera.com/articles/view/taking-your-web-apps-offline-web-storage-appcache-websql/

On Sun, 10 Apr 2011 01:46:05 +0530, Ilkka Huotari <ilkkah at gmail.com> wrote:

> Hi,
>
> I'm trying to figure out a way to make my app work offline. The app is
> relatively simple. There isn't even any javascript, only a few pages
> of html, and the main page, which contains the list of pages. You can
> think of it as a catalog of pages.
>
> I am now experimenting with cache manifest, and I would really like to
> to implement it in a way that the "offline cache" kicks in only when
> the user is actually offline. Now the problem I'm having is that the
> offline cache (the name of which is confusing), seems to interfere
> when the user is actually online. The result is, that page (the
> homepage of the application) comes from cache, and not from the
> server, and the user doesn't see the data he should be seeing, but
> sees the old cached version.
>
> So, what I would like to achieve is this: I would like the offline
> cache to be used only when the user is offline. Does this sound
> reasonable? It may be that it's not always clear if the user is
> offline or online, but now the problem is pretty hard as the cache
> interferes "too much".
>
> Also, in my opinion, caching in the web world is quite complex from
> the start ... Now it seem that cache manifest adds more to this
> complexity. I hope I'm missing the point (I'm new on this, I very well
> might be) and cache manifest can be used so that it starts making
> sense to me :) But now I don't quite understand how to use it right.
>
> Did this bring any thoughts to anyone?
>
> Thanks,
> Ilkka
> _______________________________________________
> Help mailing list
> Help at lists.whatwg.org
> http://lists.whatwg.org/listinfo.cgi/help-whatwg.org


-- 
Shwetank Dixit
Web Evangelist,
Site Compatibility / Developer Relations / Consumer Products Group
Member - W3C Mobile Web for Social Development (MW4D) Group
Member - Web Standards Project (WaSP) - International Liaison Group
Opera Software - www.opera.com

Using Opera's revolutionary email client: http://www.opera.com/mail/



More information about the Help mailing list