[html5] Offline apps

Ilkka Huotari ilkkah at gmail.com
Sun Apr 10 03:51:37 PDT 2011


What I was trying to implement is sort of explained here (the
Wikipedia example):
http://diveintohtml5.org/offline.html#fallback

Relevant parts:
"What does this do? First, consider a site that contains millions of
pages, like Wikipedia. You couldn’t possibly download the entire site,
nor would you want to. But suppose you could make part of it available
offline. But how would you decide which pages to cache? How about
this: every page you ever look at on a hypothetical offline-enabled
Wikipedia would be downloaded and cached." ..

So, there's an example what I was trying to do, I tried to lazily
cache the pages. This might work with the more static pages, but I'm
having trouble with the more dynamic ones (I guess the same could be
said in regards the normal cache mechanisms). Normally I don't want to
cache those dynamic pages at all, but I thought I could do that with
the appcache - and show them to the user when he is offline.

I think I would be having problems with the normal cache mechanisms as
well (as I don't *really* want to cache the dynamic pages, well, I'd
want to keep an offline copy in case it is needed).

Well, maybe I have to take a look at some working examples that have
been done with the appcache. Now I don't quite understand where I
could use it..

Anyway, thanks for your interest/discussion. I take the Trojan horse
comment as a compliment, if it was directed at me :)

Ilkka



On Sun, Apr 10, 2011 at 9:03 AM, Jukka K. Korpela
<jukka.k.korpela at kolumbus.fi> wrote:
> Ilkka Huotari wrote:
>
>> To summarize my ideas/problems so far:
>>
>> - I would like to load certain pages from the web server when I'm
>> online (i.e. not from the cache).
>> - If I'm offline, I would like to load these same pages from the
>> cache.
>
> That's more or less what happens normally, though subject to caching
> conditions. The best approach to control such issues is via normal cache
> control, see http://www.mnot.net/cache_docs/
>
>> - Not sure if the above is supposed to be possible with the appcache
>> mechanism.
>
> No, the appcache mechanism is supposed to make an application work as if the
> user were offline, except that when he is actually online, the browser
> checks for the _cache manifest_ only (and if its contents has changed, the
> application cache is refreshed). It bypasses normal cache control, freshness
> information etc.
>
>> Problems:
>> - Pages are shown from the cache to user even when the user is online.
>
> So this works as defined.
>
>> This seems a bit unnecessary, especially if I have defined
>> "Cache-Control: no-cache" for the said pages.
>
> It's part of the idea of application cache. I wonder how useful the idea
> is... but in any case, it's not useful as a general replacement for normal
> caching.
>
> I wonder why you wish to defeat normal caching when the user is online, yet
> consider using an application cache. Preventing all caching of a resource
> normally makes sense only if the contents is automatically generated with
> unique data or updated by some automated process(es)  or otherwise very
> frequently (say, a news page), or something like that.
>
>> - Pages are cached/shown from the cache even if I put them into
>> network section. I really don't understand why, is this a bug in
>> browsers?
>
> Could be a bug. In my tests, application cache manifests haven't worked that
> perfectly, though in my early experiments, some oddities were caused by my
> mistakes. Browser tools for inspecting application caches seem incomplete -
> at some point, it seemed to be possible to see what happens, in Resources >
> Application Cache in debug mode in Google Chrome (the one you enter by
> right-clicking and selecting Inspect Element), but now it appears to be
> empty.
>
>> Also, the manifest file change isn't really solving these problems,
>> imo, because it means that multiple page page loads are needed until
>> the change is shown.
>
> By the current definition of application cache, changing the manifest
> contents (changing last write is enough - it's really a matter of contents
> matching, which is rather odd design, if you ask me) is the way to force
> browsers (when online) to refresh the application cache.
>
> --
> Yucca, http://www.cs.tut.fi/~jkorpela/
> _______________________________________________
> Help mailing list
> Help at lists.whatwg.org
> http://lists.whatwg.org/listinfo.cgi/help-whatwg.org
>



More information about the Help mailing list