Is REST “faster”?
I was in a REST/Web2.0 workshop, and someone asked how REST, since through HTTP, which is a stateless protocol, is any faster than other, or previous approaches.
I’m not sure that REST does anything to speed up HTTP’s request/response mechanisms; but using AJAX surely enhances the user experience with perceived responsiveness given the nature of AJAX by doing things asynchronously.
Or is there more to it?
Paul Ramsey said,
Wrote on July 21, 2008 @ 17:54:20
Because REST *respects* HTTPs mechanisms, it is more open to leveraging aspects of HTTP, like cache-control, that more RPC-oriented architectures (particularly xml-package-posting ones) cannot. And of course, caching can make things go much much much faster.
Posted from CanadaSafari 525.20.1 Mac OS X 10.5.4
Sean Gillies said,
Wrote on July 22, 2008 @ 09:18:53
No, REST isn’t faster. Since the REST style constrains you to not store client state on the server, and to communicate by passing around representations of application state, a poorly designed application could actually be slower. To compensate, you use the caching mechanisms built into HTTP (as Paul said). Your messages don’t go any faster, of course, but you avoid shipping representations of state needlessly.
Browser AJAX isn’t an aspect of REST style at all, and works just as well with non-RESTful service like HTTP W*S.
Posted from United StatesMozilla Firefox 3.0 Linux