All of my writings are based on Computer Networking: A Top-Down Approach, 8th edition by James F. Kurose and Keith W. Ross.
2.2.4 User-Server Interaction: Cookies
As HTTP server is stateless, we need Cookies to identify users, either to restrict user access or serve content as a function of the user identity.
Four components of Cookie technology
- HTTP response message
- HTTP request message
- the user's browser
- a back-end database at the Web site
How the Cookie works
- User visit "something site" - HTTP request message
- The "something site" web server sends HTTP response message
-> Set-cookie : something - The user's browser set cookie
- User revisit "something site" use cookie
- "something site" remembers the user
2.2.5 Web Caching
Web cache (= proxy server): network entity that satisfies HTTP requests on the behalf of an origin Web server.
Sequence of Web Cache
- browser establishes a TCP connection to the Web cache, and sends an HTTP request for the object to the Web cache.
- The Web cache checks if it has a copy, if it has, the Web cache returns the object within an HTTP response message
- If it doesn't have the copy, the Web cache opens a TCP connection to the origin server.
- Web cache sends an HTTP request for the object into the cache-to-server TCP connection. When the server receives this request, the origin server sends the object within an HTTP response to the Web cache.
- Web cache receives the object, stores a copy, and sends a copy within an HTTP response message(using the TCP connection between the client browser and the Web cache)
The reason Web caching has been deployed on the Internet
- Web cache can substantially reduce the response time for a client request.
-> bottleneck bandwidth(client - origin server) VS bottleneck bandwidth(client - cache)
particularly, if bottleneck bandwidth (client - origin) is much less than the other one - Web caches can substantially reduce Web traffic on an institution's access link to the Internet.
-> Does not have to upgrade bandwidth - reduce cost
substantially reduce Web traffic on the Internet whole, improve performance for all applications