Web and HTTP
HTTP overview
HyperText Transfer Protocol
HTTP overview (continued)
(Underlying protocol, HTTP state, Protocol state)
HTTP connections
a. non-persistent HTTP
- At most one object sent over TCP connection
- Connection then closed
- Downloading multiple objects required multiple connections
b. persistent HTTP
- Multiple objects can be sent over single TCP connection between client, server.
A web page can consist of many different files
Median number of objects embedded in a webpage
Non-Persistent HTTP
The “classic” approach in HTTP/1.0 is to use one HTTP request per TCP connection, serially.
Non-persistent HTTP: response time
Persistent HTTP
non-persistent HTTP issues:
- requires 2 RTTs per object
- OS overhead for each TCP connection
- browsers often open parallel TCP connections to fetch referenced objects
persistent HTTP:
- server leaves connection open after sending response
- subsequent HTTP messages between same client/server sent over open connection
- client sends requests as soon as it encounters a referenced object
- as little as one RTT for all the referenced objects
Persistent HTTP 2
HTTP request message
HTTP request message: general format
Uploading form input
POST method:
- web page often includes form input
- input is uploaded to server in entity body
URL method:
- uses GET method
- input is uploaded in URL field of request line:
HTTP response message
HTTP response status codes
User-server state: cookies
Four components of cookies
1) Cookie header line of HTTP response message
2) Cookie header line in next HTTP request message
3) Cookie file kept on user’s host, managed by user’s browser
4) Back-end database at Web site
Cookies: keeping “state” (cont.)
Cookies (continued)
Cookies + Third Parties
How it works
50% of the websites are using more than 100 3rd party cookies
What can we do about it?
Evolution of Serving Web Content
¨ In the beginning…
¤ …there was a single server
¤ Probably located in a closet
¤ And it probably served blinking text
¨ Issues with this model
¤ Site reliability
n Unplugging cable, hardware failure, natural disaster
¤ Scalability
n Flash crowds (aka Slashdotting)