[whatwg] Application Cache Quota Proposal
pecoraro at apple.com
Mon Jul 19 16:06:24 PDT 2010
Proposal to Add Per-Origin Quotas to Application Cache:
Application Caches right now do not have any storage limitations. This has
clear issues when used on devices with limited storage capacity. Other
programmatic client side storages do have quotas mentioned in their specs
or in practice:
- Web Storage StorageAreas (localStorage and sessionStorage)
QUOTA_EXCEEDED_ERR exception when reaching their quota.
- Web SQL Databases
QUOTA_EXCEEDED_ERR exception when reaching its quota.
- Indexed DB
RECOVERABLE_ERR exception when "... or the storage quota was reached ... "
"Minimum size" a client should support was stated in the HTTP Spec as
4kb, so that is often quoted and respected as the size to not exceed.
These quotas are often global, some kind of user setting, or are
per-origin. Application Caches are missing such a quota.
The entire "Disk Space" section of Web SQL Databases could equally apply
to Application Caches:
The manifest file specifies the resources to cache, and the user agent
caches each resource. There may be multiple application caches for a
single domain. Be it through multiple Application Hosts, or multiple
Application Groups (unique by their manifest URL, but not domain).
A user agent can do as it pleases, but the only real limit is the remaining
space of the file system. If a resource cannot be cached because there is no
more space left, there is no way around that.
The likely behavior would be the user agent emits an "error" event. However,
storage limits are not specified in the spec as an error condition:
Suggested Additions to the Spec:
Under the "error" event description , suggest that it could be fired as a
result of reaching a quota limit. The spec often uses the phrase "store this
resource". That part could just be described somewhere in the specification
as possibly raising an "error" event.
The phrasing in the other Specs are:
[[ (Setting could fail if, e.g., the user has disabled storage for the
site, or if the quota has been exceeded.) ]]
[[ The statement failed because there was not enough remaining storage
space, or the storage quota was reached and the user declined to give
more space to the database. ]]
[[ For example, there was not enough remaining storage space, or the
storage quota was reached and the user declined to give more space to
the database. ]]
I would most like to see something like the "Disk Space" section of Web SQL
Databases. This section describes actions the user agent "should" take to
give the user some control over the quota. Such as viewing, setting, and
being notified when the quota is reached:
These would be the same as the use cases for quotas or storage limits on
all the other client side storage implementations which have quotas. But
this would also be useful to define the expected behavior when reaching
such limits for interoperability between Application Cache implementations.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg