JSON

Developing the next generation of open data interchange

« PreviousNext »

A Standards Based Technique for Batching Ajax Requests

3 January 2008

 

A little off the topic of JSON, but I recently wrote an article for Comet Daily that was a proposal for a standards based approach to comet communication. One of the key components of the proposal that made it go, was the mechanism for using standards to coherently subscribe and respond to multiple resources. By applying the message/http content type to HTTP messages, multiple HTTP messages can be wrapped up in single message using a standard MIME type. In the MIME type specification, the message/http is defined in the context of email messages as being a container for multiple email messages. However, it does not take too much imagination to infer that when this content type is used in the context of a HTTP messages, that the content would be a multipart message composed of multiple HTTP messages.

While there are certainly client/server frameworks out there that support Ajax batching, they all do so with their own internal protocol. Using the message/http content type opens the door for batched Ajax requests with an open protocol that would allow client libraries to send batched requests to various server side components. Perhaps at some point, I will try to create a client library that will modify the XmlHttpRequest object to support batched requests using this technique, and a Java filter that can understand and segregate the requests using this technique.

Update: Originally I suggested using multipart/digest as the content type, but I believe that message/http is more semantically correct.

Posted in Ajax | Trackback | del.icio.us | Top Of Page

No comments yet

Leave a Reply