HTTP Upgrade Product: SPDY

Source: Internet
Author: User
Tags http 2

first, what is Spdy?

Spdy is an application-layer protocol developed by Google based on Transmission Control Protocol (TCP). has been used in Google Chrome to access Google's SSL encryption service. Spdy is not currently a standard protocol, but Spdy's development team has started to push spdy into a formal standard (now the Internet draft), and Google Chrome,mozilla Firefox and Opera have supported the Spdy protocol. The SPDY protocol is similar to HTTP, but is designed to shorten the load time of Web pages and improve security. The SPDY protocol shortens load times by compressing, multiplexing, and prioritizing. SPDY is not an acronym, but simply an abbreviation for "speedy".

The purpose of design spdy is to reduce the load time of Web pages. With priority and multiplexing, Spdy makes it possible to transfer resources such as Web content and images with only one TCP connection. TLS encryption is widely used in spdy, and the transfer content is also compressed in gzip or deflate format (unlike HTTP, HTTP headers are not compressed). In addition, in addition to HTTP-like Web servers passively waiting for the browser to initiate requests, Spdy Web server can also actively push content.

second, what is the difference between Spdy and HTTP?

The World Wide Web was developed on the basis of the HTTP protocol, which is an application-layer protocol that uses TCP as the transport layer. This means that each request for a client is created with a new server connection. Although it initially helps to make the problem easier, it can cause problems with the web's current needs. Spdy is designed to address these shortcomings in the HTTP protocol. It uses a single connection to handle requests/responses between all clients and servers.

Spdy is not used to replace HTTP, it simply modifies the way HTTP requests and responses are transmitted over the network, which means that only one spdy transport layer is added, and all existing service-side applications do not have to make any modifications. When transmitted using SPDY, HTTP requests are processed, markup simplified, and compressed. For example, each SPDY endpoint keeps track of each HTTP header that has been sent in the previous request, thus avoiding repeated sending of the unchanged head. The data portion of a message that has not yet been sent will be sent after it is compressed.

On the left is normal HTTPS loading, and the right is SPDY loading.

The SPDY protocol simply optimizes HTTP for performance, and its core idea is to minimize the number of connections, while the semantics of HTTP are not changed much. Specifically, SPDY uses HTTP methods and headers, but removes some headers and writes the parts of HTTP to manage connections and data transfer formats, so it's basically compatible with HTTP.

Google in the SPDY white Paper said to infiltrate the protocol stack and replace the Transport Layer Protocol (TCP), but because it is very difficult to deploy or implement temporarily, so Google is ready to first improve the application layer protocol HTTP, first add a session layer above SSL to achieve The SPDY protocol, and the GET and POST message formats for HTTP remain the same, that is, all existing service-side applications do not have to make any modifications.

So at present, the purpose of SPDY is to strengthen HTTP, which is a better implementation and support for HTTP. As for the future SPDY widely used will not play a civet cat for the Prince, replace the HTTP and completely subvert the entire Internet is Google's thing.

The core of Spdy is the frame management layer (framing layer), which manages the connection between two endpoints and the transfer of data. There can be multiple streams of data between two endpoints. At the top of the frame management layer, Spdy implements HTTP request/response processing. This allows us to use spdy without making too much or no changes to the existing site.

third, why to establish spdy?

It has been more than 10 years since the World Wide Web's father Tim Berners-Li Faming and pushed HTTP to become the most popular protocol in today's Internet (the HTTP 1.1 specification has also stalled for 13 years), with the rapid development of WEB technology in particular HTML5 evolving, including WebSockets protocol The emergence of the current network environment changes, transmission content changes, the original HTTP specification has gradually failed to meet the needs of people, HTTP needs further development, so the Httpbis team has been formed and authorized to consider HTTP 2.0, hoping to solve the current HTTP is a lot of restrictions. And SPDY is Google's attempt to become the next-generation Internet Communication Protocol on the eve of HTTP from 1.1 to 2.0, which has long been considered the only viable option for HTTP 2.0.

lack of HTTP protocol

      • Single connection request is inefficient. The biggest drawback of the HTTP protocol is that each TCP connection can only have one HTTP request, that is, each HTTP connection requests only one resource, and the browser can only resolve by establishing multiple connections. In addition, in HTTP, the request is a strict first-in, first-out (FIFO), and if the intermediate request processing time is longer, the subsequent request will be blocked.

      • HTTP only allows the client to initiate the request. The server can only wait for the client to send a request, which is a shackle in the situation where the preload can be satisfied.

      • HTTP header redundancy. HTTP headers are sent repeatedly in the same session, and the intermediate redundancy information, such as User-agent, Host, and so on, does not need to be sent repeatedly, wasting bandwidth and resources.

advantages of the SPDY protocol

      • Multiplexing request optimization. SPDY specifies that there can be an unlimited number of concurrent requests within a SPDY connection, which allows multiple concurrent HTTP requests to share a single TCP session. This allows the SPDY to make TCP more efficient by reusing multiple requests on a single TCP connection instead of opening a separate connection for each request, so that all resources on the Web page can be routed by establishing a TCP connection, not only to reduce the time of the message interaction round-trip, but also to avoid the delay caused by creating new connections. In addition, SPDY multiplexing can be set priority, rather than the traditional HTTP as strictly according to first-in, first-out a processing request, it will selectively transfer CSS such a more important resource, and then transfer the site icon and other less important resources, you can avoid the non-critical resources to occupy the network channel problems, improve The performance of TCP.

      • Support for server push technology. The server can proactively initiate communication to the client to push data to the client, which allows the user to maintain a fast network.

      • SPDY compressed the HTTP header. Discard unnecessary header information, after compression can save the time and bandwidth of redundant data transmission.

      • Enforces the use of the SSL transport protocol. Google believes that the future direction of the Web must be a secure network connection, all requests for SSL encryption, information transmission more secure.

According to Google, the only thing SPDY was created to do was make the Web faster (strive to making the whole web fast), and its name SPDY (Speedy) seemed to imply that.

    • Ordinary users: For the user, hidden in the browser under the SPDY compared to HTTP no difference, but we can feel that Google services in Chrome under the unusually fast, this is SPDY credit. In addition, the website information transmission encryption does not have to worry about the interception of information, greatly increased security and confidentiality.

    • Front-end personnel: For front-end engineers, to improve page efficiency is a very important thing, most of the time, like CSS Sprites and other methods to optimize the site, for the page load when each picture, icon Ask for a connection or even use a different page to refer to various images to reduce the number of requests for a picture within a page. Now, with SPDY's request optimization, you can rearrange the order of requests, which can greatly mitigate the impact of a picture request on page loading.

    • OPS: SPDY reduces the number of connections while also reducing the resources consumed by each client on the server, freeing up more memory and CPUs. In addition, SPDY can be combined to increase the browsing speed, page load delay improvements of up to 64%.

HTTP Upgrade Product: SPDY

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.