Looks like no one added any tags here yet for you.
Hypertext Transfer Protocol (HTTP) Overview
HTTP is a client-server protocol used by web browsers to interact with servers over TCP/IP networks.
It follows a request/response paradigm with message headers and a body.
Stateless: Each request-response is treated independently.
Some transactions requiring state maintenance can use proxies and cookies.
HTTP Versions
HTTP uses a <major>.<minor> version numbering scheme.
HTTP/1.1, defined in RFC 2616, is widely supported and focuses on persistent connections.
HTTP/2.0 (2015) introduced binary format, multiplexing, and header compression.
Persistent connections in HTTP/1.1 reduce Round Trip Times (RTT) compared to non-persistent.
HTTP Connections
HTTP connections can be persistent or non-persistent.
Non-persistent (HTTP/1.0) requires a new TCP connection for each object.
Persistent (HTTP/1.1) keeps the connection open for multiple objects, reducing RTT.
Persistent connections save CPU time, reduce latency, and support pipelining.
HTTP Communication Model
Handshaking: Opening a TCP connection to the web server.
Client request: HTTP client sends an HTTP Request message specifying the resource.
Server response: Server reads the request, takes action, and creates an HTTP response.
Closing: Optional step for closing the connection.
HTTP Request Message
Start Line: Request method, Request URI, HTTP version.
Headers: General, request, and entity headers.
Request methods include GET, POST, PUT, DELETE, etc.
HTTP Response Message
Status Line: HTTP version, Status Code, Status Phrase.
Headers: General, response, and entity headers.
Status codes categorized into 1xx, 2xx, 3xx, 4xx, and 5xx groups.
HTTPS (Secure HTTP)
HTTPS combines HTTP with SSL/TLS protocols for secure communication.
SSL layer verifies direct communication and ensures data confidentiality.
Used for secure transactions, HTTPS encrypts and decrypts data during transmission.
Cookies for State Retention
Cookies are small pieces of information sent from the server to the client.
They retain state in the stateless HTTP protocol.
Cookies have a lifespan, are stored on the client, and sent back to the server with each request.
Creating Cookies
Set-Cookie header is sent from the server to create cookies.
Cookies are sent back with subsequent requests to the same server.
Cookies can have expiration, domain, and path specifications.
HTTP Cache
Caching optimizes performance by storing reusable responses.
Types of caching include browser cache, intermediary caching proxies, and reverse cache.
Advantages include decreased network costs, improved responsiveness, and increased performance.
Cache Consistency
Cache consistency ensures cached copies are eventually updated.
Pull method: Cached pages have expiration times; fresh copies obtained on expiration.
Push method: Server sends update requests to web proxies when a page is modified.