RFC: Streams support - fragmented response


#1

As Streams are getting forward through standardization - JSON API may consider alternative format for Fetching Data response, that will utilize streaming capabilities of the browsers.

ReadableStream could go though response having every record separated via new line, which would allow progressive content loading for large responses or at low connectivity.

Possible fragmentation may look something like that:

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{ "links": { "self": "http://example.com/articles" }, "data": [
{ "type": "articles", "id": "1", "attributes": { "title": "JSON API paints my bikeshed!" } }, 
{ "type": "articles", "id": "2", "attributes": { "title": "Rails is Omakase" } }
]}

Is that a direction worth consideration?