Support

Find answers, guides, and tutorials to supercharge your content delivery.

SPDY Protocol

Updated on February 22, 2023
SPDY Protocol

Have you ever experienced slow website loading times? Or maybe you've encountered a frustrating delay when streaming videos online? These issues can be caused by various factors, but one possible culprit is the protocol used to transfer data between your web browser and the server hosting the website or video.

That's where SPDY comes in. SPDY (pronounced SPeeDY) is a networking protocol developed by Google to improve the performance of web browsing. In this article, we'll dive into what SPDY is, how it works, and its impact on web browsing.

What is SPDY?

SPDY is a protocol for transporting web content over the internet, designed to reduce page load times and improve overall performance. The protocol was first introduced by Google in 2009 and has since been adopted by various web browsers, including Google Chrome, Firefox, and Opera. SPDY aims to solve some of the limitations of the traditional HTTP (Hypertext Transfer Protocol) protocol, which was designed in the early days of the internet and has since become outdated. HTTP was primarily designed for transferring small amounts of text-based data, such as HTML files, but it struggles with larger, more complex websites with multiple files, images, and other media.

The most important goal of SPDY is to transport web content using fewer TCP connections. It does this by multiplexing large numbers of transactions onto one TLS connection.

- Patrick McManus, Mozilla Hacks

HTTP/1.1 vs SPDY3.1

The SPDY protocol works with HTTP by manipulating web traffic as it leaves the server. SPDY is dependant on HTTP to work, however, helps improve many of the drawbacks that are directly associated with using HTTP. The following is a table that identifies the limitations that exists with HTTP and what SPDY does to help alleviate those limitations.

HTTP/1.1SPDY3.1
Performs serialized transfers meaning it can transfer multiple resources over one connection if keep-alive is enabled. However it still processes each request one at a time, resulting in server delays and under-utilized resources.Performs parallelized transfers, allowing multiple requests to be to be transferred simultaneously over a single connection, saving time on trips between client and server.
Only the client can initiate a request. This means the server must always wait to receive a request from the client for a resource.Enables the server to "push" resources to the client that it knows the client will need (i.e JavaScript, CSS, etc.).
Sends uncompressed request and response headers.Allows the client and server to compress request and response headers; cutting down on bandwidth usage.
Repeatedly sends duplicate headers across requests on the same channel.Removes duplicate headers thus reducing the amount of bandwidth needed.

How the SPDY protocol works

SPDY works by adding an additional layer on top of SSL that allows it to improve the existing functionality of HTTP.

Say for example, a browser accesses a site that is SPDY enabled. If the browser supports SPDY, it will send additional headers to the server to let the server know. Once the server receives the response from the browser and see's that it is compatible, the server modifies HTTP traffic to include the performance optimization features brought on by SPDY.

Alternatively, if the browser does not support SPDY, the server will deliver traffic through the conventional HTTP protocol.

What are the benefits of SPDY?

SPDY has several benefits, including:

  1. Faster page load times: SPDY reduces the overall latency of web browsing by allowing multiple requests to be sent over a single connection, prioritizing requests, compressing headers, and enabling server push.

  2. Improved web browsing experience: By reducing the time it takes to load a webpage, SPDY can improve the overall web browsing experience. Users can see the main content of a page faster, and videos and other media can stream more smoothly.

  3. Reduced server load: By reducing the number of connections required to load a webpage, SPDY can reduce the load on servers, which can improve website performance for all users.

  4. Better security: SPDY requires the use of TLS, which helps to secure web browsing by encrypting internet traffic.

  5. Compatibility with existing infrastructure: SPDY is designed to work with existing internet infrastructure and can be implemented without requiring major changes to web servers or clients.

How to enable SPDY on your origin server

Enabling SPDY on your origin server is straightforward and can be done in just a couple of steps in Apache and Nginx.

Apache

Google provides the mod_spdy module for Apache 2.2 users (Apache 2.4 users will need to use an adapted version of mod_spdy). In order to get started you must download the appropriate package for your system. The architecture of your system can be determined by running uname -m

For Debian/Ubuntu users, you must run the following commands (as root):

dpkg -i mod-spdy-*.deb
apt-get -f install

For CentOS/Fedora users, you must run the following commands (as root):

yum install at  (if you do not already have 'at' installed)
rpm -U mod-spdy-*.rpm

Nginx

To enable Nginx with SPDY, Nginx users must first determine what version they have in order to ensure it is compiled with SPDY support:

$ nginx -V

If you don't see -with-http_spdy_module somewhere in the output you will need to get a build that is SPDY enabled.

Once the version verification is complete, you can open the server block config for your SSL site and change:

listen 443 ssl;

to:

listen 443 ssl spdy;

then reload your config:

$ service nginx reload

SPDY is now enabled on your Nginx server.

Is SPDY still in use?

SPDY is no longer in active development, as it has been replaced by the newer HTTP/2 protocol. HTTP/2 builds on the success of SPDY, incorporating many of its features while improving on others. However, many of the benefits of SPDY can still be seen in web browsing today, as SPDY is still supported by some browsers and web servers. In fact, some websites may still use SPDY even if the web browser supports HTTP/2, as SPDY is often faster on older web servers.

It's worth noting that not all web browsers support SPDY, and some web servers may not support it either. However, as more and more web browsers and servers switch to HTTP/2, the need for SPDY will diminish.

Overall, SPDY has been an important step forward in the evolution of web browsing. By addressing some of the limitations of HTTP, SPDY has helped to improve the performance of web browsing, making it faster, more reliable, and more secure.

In conclusion, while SPDY may no longer be actively developed, its impact on web browsing continues to be felt today. As the internet continues to evolve, we can expect to see more innovations like SPDY that improve the performance and security of web browsing.

Supercharge your content delivery 🚀

Try KeyCDN with a free 14 day trial, no credit card required.

Get started
KeyCDN uses cookies to make its website easier to use. Learn more