Ray's playground

 

HTTP Overview(Chapter B of High performance Web Sites)

      HTTP is a client/server protocol made up of requests and responses.A browser
sends an HTTP request for a specific URL, and a server hosting that URL sends back
an HTTP response.Like many Internet services, the protocol uses a simple, plaintext
format.The types of requests are GET, POST, HEAD, PUT, DELETE,
OPTIONS, and TRACE.

Compression
      The size of the response is reduced using compression if both the browser and server
support it.Browsers announce their support of compression using the Accept-
Encoding header.Servers identify compressed responses using the Content-Encoding
header.

Conditional GET Requests
      If the browser has a copy of the component in its cache, but isn’t sure whether it’s
still valid, a conditional GET request is made.If the cached copy is still valid, the
browser uses the copy from its cache, resulting in a smaller response and a faster user
experience.

Expires
      Conditional GET requests and 304 responses help pages load faster, but they still
require making a roundtrip between the client and server to perform the validity
check.The Expires header eliminates the need to check with the server by making it
clear whether the browser can use its cached copy of a component.

Keep-Alive
      HTTP is built on top of Transmission Control Protocol (TCP).In early implementations
of HTTP, each HTTP request required opening a new socket connection.This
is inefficient because many HTTP requests in a web page go to the same server.For
example, most requests for images in a web page all go to a common image server.
Persistent Connections (also known as Keep-Alive in HTTP/1.0) was introduced to
solve the inefficiency of opening and closing multiple socket connections to the same
server.It lets browsers make multiple requests over a single connection.Browsers
and servers use the Connection header to indicate Keep-Alive support.The
Connection header looks the same in the server’s response.

posted on 2009-09-25 20:42  Ray Z  阅读(241)  评论(0编辑  收藏  举报

导航