HTTP is a venerable protocol, but over the last decade, websites have developed in ways that could not have been foreseen by HTTP’s designers. Various limitations in the HTTP protocol result in latency for end users, which is harmful both for conversion rates on websites and user experience in web applications.
SPDY was developed by Google to replace the HTTP protocol and resolve a number of these problems. Google Chrome has long supported SPDY. With the recent release of Firefox 13, which has SPDY enabled by default, over 60 percent of browsers support SPDY (according to StatCounter’s figures), which means it’s time to take a serious look at it.
Back in the day, HTTP was more than adequately equipped to deal with the demands of a nascent web, but some features present a roadblock to the development of low-latency web applications, including:
- Single request per connection
- No server-side request initiation
- Redundant headers
- Lack of mandatory data compression
Google developed SPDY (which is not an acronym, but a compression of SPeeDy) to address these problems, with the aim of reducing page load times by 50 percent. SPDY was built on top of the SSL protocol to ensure secure communications and introduces multiplexed streams, request prioritization, and server push.
Multiplexed streams are much more efficient than the serialized streams of HTTP, meaning clients are not stuck waiting for resources, and far fewer TCP connections need to be made. Request prioritization allows clients to attach priorities to requested resources so that resources of lesser importance don’t block retrieval of more critical resources. SPDY also implements header compression which can result in an 88 percent reduction in header sizes. With the inclusion of server push using the X-Associated-Content header, the server does not have to wait for clients to request resources. Full details of the protocol can be viewed in Google’s SPDY white paper.
Many of Google’s services are implemented through SPDY including search and GMail, Amazon’s Silk web browser uses SPDY for communicating with Amazon’s servers. Twitter is also SPDY enabled, and with the recent increased browser support we can expect to see take-up among smaller sites accelerating.
Of course, clients are only one side of the story; there also needs to be server side support. At the moment, Apache supports SPDY though the mod_spdy plugin developed by Google.. Nginx support is promised in the very near future. SPDY can be implemented for a site without making any changes to the site’s code.
If you have experience implementing SPDY or have plans to implement it in the future, let us know how it’s going in the comments below.