Re: Fixing appcache: a proposal to get us started

On Tue, Mar 26, 2013 at 1:48 AM, James Graham <> wrote:
> On 03/26/2013 08:02 AM, Jonas Sicking wrote:
>> Another "feature" that we are proposing is to drop the current
>> manifest format and instead use a JSON based one. The most simple
>> reason for this is that we noticed that the information we need to
>> express quickly became complex enough that using a format with simple
>> parsing rules was beneficial.
>> A format based on extending the current appcache format would be no
>> problem for a UA to parse. However the complexity that we need to
>> express resulted in something that's too hard for a human to manually
>> write, or for a human to understand when looking at somebody else's
>> manifest in order to learn.
>> The simple parsing rules for JSON seemed like a better fit. It also
>> provides more of an opportunity to extend the format in the future.
>> JSON also has advantages when it comes to creating APIs exposed to
>> webpages for interacting with appcaches. More about this below.
> Some slightly trivial feedback: I am worried about using a format with no
> support for comments. I agree that some hypothetical JSON+comments format
> would be a good fit, but without the ability to document complex rulesets,
> it seems like we are going to create a maintenance nightmare.

I completely agree. I feel like we're stuck between a rock and a hard
place here.

On one hand we need something that supports comments. JSON only
"supports" comments using ugly hacks like:

  "//": "Remember to update this as needed",
  "version": "2",

  "//": "Need nav.css for sidebar",
  "cache": ["index.html", "index.css", "nav.css"]

On the other hand, using something other than JSON means that we loose
the ability to use existing tool chains for processing the manifest.
I'm not so worried about the UA having to write new code in order to
implement the AppCache feature itself. I'm more concerned that
serverside code that wants to process the manifest can't use a normal
JSON parser, and that client-side code that wants to load a manifest
can't use things like xhr.responseType="json".

I really don't know which downside is worse.

I definitely wish that JSON supported comments, but that doesn't seem
likely to ever happen :(

/ Jonas

Received on Wednesday, 27 March 2013 00:21:56 UTC