Comparison of HTTP 1.1 and HTTP 1.0, http1.11.0

Source: Internet
Author: User

Comparison of HTTP 1.1 and HTTP 1.0, http1.11.0
A web site may receive millions of user requests every day. To improve system efficiency, however, this also causes some performance defects, such, A webpage file containing many images does not contain real image data, but only specifies the URL of these images. When a WEB browser accesses this webpage file, the browser first needs to send a request for the webpage file. When the browser parses the HTML content in the webpage document returned by the WEB server, after the Image Tag is found, the browser sends an image download request to the server again based on the URL specified by the src attribute in the label, as shown in Figure 3.3. Figure 3.3 shows that the entire process of accessing a webpage file containing many images contains multiple requests and responses. Each request and response requires a separate connection, each connection transmits only one document and image, and the last and next requests are completely separated. Even if the image files are small, it is a relatively time-consuming process to establish and close the connection between the client and the server, and seriously affects the performance of the client and the server. When a webpage file contains the Applet, JavaScript file, CSS file, and other content, the above situation also occurs. To overcome this defect of HTTP 1.0, multiple requests and responses of a webpage file containing many images can be transmitted in one connection, however, each request and response to a separate webpage file still need to use their respective connections. Information exchange between clients and servers based on HTTP 1.1, as shown in Figure 3.4. Figure 3.4 shows that HTTP 1.1 inherits the advantages of HTTP 1.0 and overcomes the performance problems of HTTP 1.0. In addition, HTTP 1.1 also improves and expands HTTP 1.0 by adding more request headers and response headers. For example, a WEB browser cannot use the Host header to specify which WEB site on the server to access, in this way, you cannot use the WEB server to configure multiple virtual WEB sites on the same IP address and port number. In the continuous Connection of HTTP 1.1, you also need to add a new request header for implementation. For example, when the Connection request header value is Keep-Alive, the client notifies the server to keep the Connection after returning the results of this request. When the value of the Connection request header is close, the client notifies the server to close the Connection after returning the results of this request .. The old HTTP standard of deep experience in Java Web development-core basics is HTTP/1.0. Currently, the most common standard is HTTP/1.1. HTTP/1.1 is an upgrade based on HTTP/1.0. It adds some features and is fully compatible with HTTP/1.0. HTTP/1.0 does not support resumable upload of files. Currently, most Web servers use HTTP/1.1. RANGE: bytes is the new content in HTTP/1.1. Each time HTTP/1.0 transfers a file, it starts from the file header, that is, it starts at 0 bytes. RANGE: bytes = XXXX indicates that the server is required to transmit the file from the XXXX byte. This is what we usually call resumable data transfer! RFC 1945-Hypertext Transfer Protocol -- HTTP/1.0 http://www.w3.org/Protocols/rfc1945/rfc1945http://www.faqs.org/rfcs/rfc1945.htmlRFC 2616-Hypertext Transfer Protocol -- HTTP/1.1 http://www.w3.org/Protocols/rfc2616/rfc2616http://www.w3.org/Protocols/rfc2616/rfc2616.htmlhttp://www.faqs.org/rfcs/rfc2616.html (Proposed) HTTP-NG Working Grouphttp: // www.w3.org/protocols/http-ng/next generation Hypertext Transfer Protocol (HTTP-NG) To overcome the shortcomings of the current HTTP protocol, W3C (World Wide Web consortium) began to study and develop the next generation HTTP protocol? TTP-NG. It has three layers: application layer, message layer, and transmission layer. The existing WEB application is switched to the HTTP-NG platform, and the entire platform is updated to HTTP-NG. RFC 1945-Hypertext Transfer Protocol -- HTTP/1.0 Chinese Version http://man.chinaunix.net/develop/rfc/RFC1945.txthttp://www.cnpaf.net/rfc/rfc1945.txtRFC 2616-Hypertext Transfer Protocol -- HTTP/1.1 Chinese Version 1.0 and 1.1 differences, english Key Differences between HTTP/1.0 and HTTP/1.1 protocol) attached: HTTP 1.1 Status Code and its meaning status code status information meaning 100 the initial request for Continue has been accepted, the customer shall continue to send the remaining parts of the request. (HTTP 1.1 New) 101 Switching Protocols server converts client-compliant requests to another protocol (HTTP 1.1 New) 200 OK everything is normal, the response documents for GET and POST requests follow. The 201 Created server has Created a document and the Location header provides its URL. 202 Accepted has Accepted the request, but the processing has not been completed. 203 the Non-Authoritative Information document has been returned normally, but some response headers may be incorrect because the document is copied (New in HTTP 1.1 ). 204 No Content does not have a new document. The browser should continue to display the original document. This status code is useful if the user regularly refreshes the page and the Servlet can determine that the user document is new enough. 205 there is no new Content in the Reset Content, but the browser should Reset the Content displayed by it. Used to force the browser to clear the input content of the form (New in HTTP 1.1 ). 206 Partial Content the client sent a GET request with a Range header, and the server completed it (HTTP 1.1 New ). 300 the documents requested by the Multiple Choices client can be found in Multiple locations, which are listed in the returned documents. If the server needs to give priority, it should be specified in the Location response header. 301 Moved Permanently the document requested by the customer is elsewhere. The new URL is provided in the Location header and the browser should automatically access the new URL. 302 Found is similar to 301, but the new URL should be treated as a temporary alternative, rather than permanent. Note that the corresponding status information in HTTP1.0 is "Moved Temporatily ". When this status code appears, the browser can automatically access the new URL, so it is a very useful status code. Note that this status code can be replaced with 301 sometimes. For example, if the browser mistakenly requests http: // host /~ If the user (with a slash missing), some servers return 301, and some return 302. Strictly speaking, we can only assume that the browser will automatically redirect only when the original request is GET. See 307. 303 See Other is similar to 301/302. The difference is that if the original request is POST, the redirection target document specified by the Location header should be extracted through GET (New in HTTP 1.1 ). 304 The Not Modified client has a buffered document and issued a conditional request (generally, the If-Modified-Since header is provided to indicate that the customer only wants to update the document on a specified date ). The server tells the customer that the original buffer documentation can still be used. 305 the document requested by the Use Proxy client should be extracted by the Proxy server specified by the Location header (New in HTTP 1.1 ). 307 Temporary Redirect and 302 (Found) are the same. Many browsers mistakenly respond to the 302 response for redirection. Even if the original request is POST, it can only be redirected when the POST request actually responds to 303. For this reason, HTTP 1.1 adds 307 to clear the region code in several states: When a 303 response occurs, the browser can follow the redirected GET and POST requests; if a 307 response occurs, the browser can only follow the redirection to get requests. (HTTP 1.1 New) 400 Bad Request syntax error. 401 Unauthorized the customer attempted to access the password-protected page without authorization. The response contains a WWW-Authenticate header. the browser displays the username/password dialog box accordingly, and then sends a request again after entering the appropriate Authorization header. 403 Forbidden resources are unavailable. The server understands the customer's request, but rejects the request. This is usually caused by permission settings for files or directories on the server. 404 Not Found cannot find the resource at the specified position. This is also a common response. 405 Method Not Allowed request methods (GET, POST, HEAD, DELETE, PUT, TRACE, etc.) are Not applicable to specified resources. (New in HTTP 1.1) the resource specified in 406 Not Acceptable has been found, but its MIME type is incompatible with the one specified in the Accpet header (New in HTTP 1.1 ). 407 Proxy Authentication Required is similar to 401, indicating that the customer must first be authorized by the Proxy server. (HTTP 1.1 New) 408 Request Timeout within the server license wait time, the customer has not issued any Request. The customer can repeat the same request later. (HTTP 1.1 New) 409 Conflict is usually related to PUT requests. The request cannot be successful because the request conflicts with the current status of the resource. (HTTP 1.1 New) the document requested by 410 Gone is no longer available, and the server does not know which address to redirect. It differs from 404 in that if 407 is returned, the document permanently leaves the specified position, and 404 indicates that the document is unavailable for unknown reasons. (HTTP 1.1 New) 411 Length Required server cannot process the request unless the customer sends a Content-Length header. (New in HTTP 1.1) some preconditions specified in the 412 Precondition Failed Request Header fail (New in HTTP 1.1 ). 413 the size of the target Request Entity Too Large document exceeds the size that the server is willing to process. If the server thinks it can process the request later, it should provide a Retry-After header (New in HTTP 1.1 ). 414 Request URI Too Long URI is Too Long (HTTP 1.1 is new ). 416 the Requested Range Not Satisfiable server cannot meet the Range header specified by the customer in the request. (HTTP 1.1 New) the 500 Internal Server Error Server encountered unexpected circumstances and could not complete the customer's request. 501 The Not Implemented server does Not support the functions required to implement the request. For example, the customer sends a PUT request not supported by the server. 502 when the Bad Gateway server acts as a Gateway or proxy, the server returns an invalid response to access the next server to complete the request. 503 the Service Unavailable server fails to respond due to maintenance or overload. For example, Servlet may return 503 when the database connection pool is full. When the server returns 503, A Retry-After header can be provided. 504 Gateway Timeout is used by a proxy or Gateway server, indicating that the remote server cannot receive a response in a timely manner. (HTTP 1.1 New) 505 HTTP Version Not Supported server does Not support the HTTP Version specified in the request. (HTTP 1.1 New) Reference: http://blog.csdn.net/elifefly/article/details/3964766/

Related Article

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.