- From: Jamie Lokier <jamie@shareable.org>
- Date: Tue, 2 Sep 2008 07:56:17 +0100
- To: Robert Brewer <fumanchu@aminus.org>
- Cc: Kris Zyp <kris@sitepen.com>, Yves Lafon <ylafon@w3.org>, Julian Reschke <julian.reschke@gmx.de>, ietf-http-wg@w3.org
Robert Brewer wrote: > But a cache holding valid JSON items-ranges: > > "aaa" "bbb" "ccc" > > ...that wished to return them combined in a single response would have > to join them with a comma and envelop them in brackets to be valid JSON: > '["aaa", "bbb", "ccc"]'. Not just merging rules, but also splitting rules. A cache which already has items 0-100 and a strong Etag, and is asked for 50-200, could convert the request to 50-200 with a conditional request. For this, the cache needs to know how to merge and how to split the entity syntax. > There may be other media types that follow those same rules, but off the > cuff it seems pretty media-type-specific (unless we abandon the hope > that caches could do that recombination). It's certainly *not* > vendor-specific--there's no need to call them 'Dojo-items' or > 'com.dojo.items'. One possibility would be to leave the range > declaration media-type-neutral ('items') and to add range-recombination > rules to the media-type itself, so that RFC 4627 (application/json) > would eventually grow a paragraph on its rules for items-ranges. My concern was the combination of media-type "application/x-javascript" (or even "text/plain") and the "items" range is not specific enough to apply the JSON combination rules. That's what I was getting at by dojo-items. If it's only used with the "application/json" media-type, and it can define that "items" always refers to _array_ items (i.e. numbered) and the JSON _top-level_ object is an array, then I have no such concern. I'm a bit surprised that the top-level object in a JSON request would be an array, though. For round-trip minimisation in AJAX applications isn't it usual to send a bit of auxiliary metadata, or a few objects together, and therefore the top-level JSON object tends to be an object (i.e. several named data items) with one of its members being an array, rather than the top-level object being an array itself? This was also what I was getting at by dojo-items, since I imagined the merging/splitting rules would tend to apply to a sub-object rather than the top-level object. -- Jamie
Received on Tuesday, 2 September 2008 06:57:00 UTC