[whatwg] Unlimited pageStorage for App Cached web pages

Felix Halim felix.halim at gmail.com
Mon May 30 22:44:16 PDT 2011


On Mon, May 30, 2011 at 10:39 PM, Bjartur Thorlacius
<svartman95 at gmail.com> wrote:
> The following is how I understand your requirements; please correct me where
> correction is due.
> You've got two types of resources:
>
>  1. static resources, to be retrieved once and cached indefinitely
>  2. dynamic resources, to be updated whenever possible while always
>     keeping the last version

The dynamic resources only updated if the user visit the particular
app cached web-page.

Remember that the dynamic resources I'm talking about here is NOT
shared between other web-cached pages (even they are in the same
domain).


> The former is easy to achieve, but user agents tend to throw away stale
> versions as to not present outdated information to the user and to save
> storage space.

The user agent only need to keep the latest version.
It's fine to throw away the outdated one if you have the latest.

> You want user agents to fetch the latest version whenever possible, but keep
> an old copy for when your servers are unreachable.

The "whenever possible" is when the user revisit the cached page.
The "old" here means the latest version that was cached..

> 5MB ought to be enough for anyone.

You were joking, right? :D

5MB for each App Cached web-page is probably OK.
However, 5MB localStorage quota for each domain is NOT OK.


> If all you want to do is store mutable resources for offline use and
> validate them if possible, but returning the cached entry (or entity) if
> validation is impossible, simply serve the resources with an Expires header
> set to a date in the past.

Here is an example of how I want the App Cache to behave:

First, it always try to fetch the main page, and all its
static/dynamic resources and display it (just like normal web page).
Then some time later, if the user want's to visit the SAME page again
but the user is offline or the server is unavailable, then the latest
cache of the page is displayed.

In the sense, it's exactly like "working offline mode" whenever the
user is offline or the server is not responding.

The current App Cache design updates the cache to the latest version
in the background when the user visit the page for the second time and
then it needs to refresh the page to actually update the display. This
is annoying since the user will first see stale data, then a few
second later, it's updated with a giant refresh (including all the
static resources). This is because the App Cache is too COARSE
grained. It doesn't know what actually changes (which data are static,
which data are dynamic). That is another reason why we need
pageStorage: to separate the dynamic and the static resources.

Felix Halim



More information about the whatwg mailing list