Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can RESTful web service benefit from SPDY protocol?

Tags:

http

spdy

I am designing a RESTful web service. It will include some GET and POST requests. I am a bit confused whether the web service can benefit from SPDY protocol. I intend to use Ruby on Rails for the implementation. Are there any gems that support SPDY?

like image 397
dknight Avatar asked Jun 07 '12 10:06

dknight


1 Answers

Potentially, yes.

One of the major design goals of SPDY is to reduce and amount of latency associated with each request. The way this is accomplished is by enabling multiplexing over the same TCP connection. Additionally, SPDY does header compression, which is a big win especially for REST style interactions which often cary very small (JSON) payloads, but send large HTTP headers (cookies, etc).

So, would SPDY give you a performance boost? It depends on your application, but there are specific optimizations within SPDY which should definitely help.

As far as "gems" for Ruby. There is the spdy gem which parses the protocol, but you shouldn't need it. SPDY is a layer below HTTP and should be mostly handled for you by the server. If you're interested in experimenting with it and you're using Rails, I would recommend trying Passenger + mod_spdy.

like image 111
igrigorik Avatar answered Oct 24 '22 19:10

igrigorik