[whatwg] Application Cache for on-line sites

Michael Nordman michaeln at google.com
Fri Feb 18 17:21:17 PST 2011


On Fri, Feb 11, 2011 at 1:14 PM, Michael Nordman <michaeln at google.com> wrote:
> Once you get past the "should this be a feature" question, there are
> some questions to answer.

I'll take a stab at answering these questions.

> 1) How does an author indicate which pages should be added to the
> cache and which should not?
>
> A few ideas...
> a. <html useManifest='x'>
> b. If the main resource has a "no-store" header, don't add it to the
> cache, but do associate the document with the cache.
> c. A new manifest section to define a prefix matched namespace for these pages.

Option (c) isn't precisely targeted at individual resources, authors
would have to arrange their URL namespace more carefully to achieve
the desired results. Option (a) and (b) can be applied specifically to
individual pages offering greater control over. And option (a) is the
more explicit the two. Authors need only edit the page to get the
desired result instead of having to arrange for the appropiate http
headers. Readers of the code (and view sourcers of the pages) can more
easily determine how this page should utilize the appcache just by
looking at the source of the page.

My pick would be option (a), <html useManifest='x'>

> 2) What sequence of events does a page that just uses the cache w/o
> being added to it observe?

The same sequence of events as a master entry that does get added to the cache.

> 3) At what point do subresources in an existing appcache start getting
> utlized by such pages? What if the appcache is stale? Do subresource
> loads cause revalidation?

Swap the cache into use upon successful update completion, so again
just like for master entry pages that do get added to the cache.

But this observation is the crux of it. There's a window of time
between page loading and update completion. During that interim
resources resident in the appcache can be used to effectively augment
the browser's regular HTTP cache. For example, when the page requests
a subresource and the resource in the appcache is fresh enough per
http caching rules, it may be returned immediately w/o any validation.

WDYT?



More information about the whatwg mailing list