[whatwg] Offline Web Apps

Robert O'Callahan robert at ocallahan.org
Wed Oct 10 21:37:44 PDT 2007


On 10/10/07, Ian Hickson <ian at hixie.ch> wrote:

> On Fri, 21 Sep 2007, Robert O'Callahan wrote:
>
> -- Several Web app authors have asked for the ability to test whether a
> > resource is cached, for their online apps. For example, when you're
> > zooming in and out of a map, the application could choose which tile(s)
> > to use for the animation by scaling them up or down. This would also be
> > convenient for offline use, where a resource might not necessarily be in
> > the offline cache but you could use it if it happened to be available.
>
> Interesting. This isn't covered yet, should we add it immediately?


I think it should be added *somewhere*, but it doesn't have to be part of
the offline spec itself (although it is particularly useful when you're
offline).

We have an experimental implementation:
http://mxr.mozilla.org/seamonkey/source/dom/public/idl/base/nsIDOMClientInformation.idl#55
That's ... underdocumented ... but the idea is this:

boolean <http://mxr.mozilla.org/seamonkey/ident?i=boolean>
isLocallyAvailable
<http://mxr.mozilla.org/seamonkey/ident?i=isLocallyAvailable>(in
DOMString <http://mxr.mozilla.org/seamonkey/ident?i=DOMString> uri
<http://mxr.mozilla.org/seamonkey/ident?i=uri>, in boolean
<http://mxr.mozilla.org/seamonkey/ident?i=boolean> whenOffline);

It should return true when the browser will load the resource given by the
URI without contacting the network. If 'whenOffline' is true then this
putative load is assumed to happen while the browser is offline/using its
offline caching functionality, if any. This is intended to allow an app to
predict, while the user is online, what loads will succeed when the user
goes offline, and in Gecko, for example, we do not perform HTTP cache
validation while the browser is in offline mode, so a page might be locally
available in offline mode but not in online mode. But we could probably get
rid of this parameter if people think it doesn't make sense.

Rob
-- 
"Two men owed money to a certain moneylender. One owed him five hundred
denarii, and the other fifty. Neither of them had the money to pay him back,
so he canceled the debts of both. Now which of them will love him more?"
Simon replied, "I suppose the one who had the bigger debt canceled." "You
have judged correctly," Jesus said. [Luke 7:41-43]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20071011/60829574/attachment-0001.htm>


More information about the whatwg mailing list