HTTP Request-Response Model
This concept explains how a client (such as a browser) sends an HTTP request to a server and the server replies with an HTTP response. Every web resource, whether it be HTML text, an image, or any multimedia file, is typically delivered through this individual request-response mechanism, ensuring the appropriate resource content is handled and transmitted according to the protocol.
Persistent and Nonpersistent Connections
Persistent connections allow multiple HTTP transactions (requests and responses) to be sent over a single TCP connection, reducing the overhead of opening a new connection for each resource. In contrast, nonpersistent connections require a new TCP connection for each request-response pair. This difference significantly affects performance and resource utilization in web communications.
Embedded Resources in Web Pages
Modern web pages often consist of multiple embedded resources, such as images, scripts, and stylesheets, in addition to the main HTML document. Each of these resources is typically fetched through its own HTTP request, though persistent connections may allow these requests to be pipelined over a single connection, while nonpersistent connections require separate connections, thus affecting the overall exchange of messages.
TCP Segmentation in HTTP
TCP segmentation refers to the process by which data is broken down into smaller segments for transmission over a network. In HTTP communications, while each complete HTTP message usually maps to distinct application-level messages, it is possible for several HTTP messages to be carried in one or more TCP segments, depending on factors like the Maximum Segment Size (MSS) and buffering strategies.
HTTP Headers and the Date Field
HTTP headers in a response message provide essential metadata about the response. The Date header, for instance, indicates the exact time at which the response was generated by the server, and it should not be confused with other metadata such as the Last-Modified header, which specifies when the resource was last changed.
HTTP Message Body
An HTTP message can include a body that carries the payload—such as HTML content, images, or file data. However, not every HTTP response is required to have a body; for example, in responses to certain types of requests or statuses, the message may be header-only, reflecting the protocol’s flexibility in handling different content delivery scenarios.