HTTP - Web Caching and Conditional Request

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

HTTP

Applications of TCP/IP network


Xiaolan Tang
Question

For those popular Web pages visited frequently in a local area, how to
improve the Web service?

Web caching

Page 2
Outline
1. Web 5. Cookies
2. HTTP overview 6. Web caching
3. HTTP connections 7. Conditional request
4. HTTP messages 8. Streaming multimedia

Page 3
Web caching
Goal: satisfying HTTP request without responding from origin server
 A proxy server caches copies of
Web objects that are requested
recently
Amy
 Client (browser) sends all HTTP Client
requests to proxy server response
 Requested object is in cache: proxy Proxy Origin
server returns object server server
 Otherwise, proxy server requests
object from origin server, then returns
Bob
it to client Client
browser setting

Page 4
Proxy server
 Proxy server acts as both
client and server
 Server for original Amy
requesting client Client
 Client for origin server response
Proxy Origin
 Proxy servers are usually server server
located closed to client
 Installed by ISP Bob
Client
(university, company,
residential ISP)

Page 5
Why Web caching?
Advantages of Web caching
 Shorten response time for client request
 Reduce traffic on institution's WAN link, backbone network,
server located in data center

Content Distribution Network (CDN)


 Many distributed caches
 Localize large amounts of traffic

Internet dense with caches

Page 6
Web caching example
Scenario:
 Average object size: 1M bits
Origin
 Average request rate from browsers to origin servers
servers:15 times/sec
 Average data rate to browsers: 15 Mbps Public Internet
 Size of HTTP request message is negligible
 RTT between institutional router and any
origin server: 2 secs 15Mbps
Result: WAN
Institutional
 LAN utilization = 15% network 100Mbps
 WAN utilization = 100% LAN
 Response delay = Internet delay + WAN
delay (queuing) + LAN delay
= 2 secs + minutes + msecs Local Web cache

Page 7
Cache update

Question: How to update the caches in proxy servers?

 Update the cache according to  Parse the header about Last-


the origin server’s update Modified time, etc., to decide
policy how long the content would
be valid

Conditional request

Page 8
Outline
1. Web 5. Cookies
2. HTTP overview 6. Web caching
3. HTTP connections 7. Conditional request
4. HTTP messages 8. Streaming multimedia

Page 9
Conditional request
Goal: Server will respond with object if the condition is met

 Condition in HTTP request message


 Most common condition:
Since a specified date and time, the object is modified

Advantages
 No object transmission delay
 Lower link utilization

Page 10
Conditional request (continued)
• Client (Cache): specify date of Client Server
cached copy in HTTP request
HTTP request msg
If-modified-since: <date> If-modified-since: Mon, 29 Object not
Jun 2020 00:00:00 GMT
modified
• Server: HTTP response HTTP response msg after <date>
message contains no object if HTTP/1.1 304 Not Modified

cached copy is up-to-date:


HTTP request msg
HTTP/1.1 304 Not Modified If-modified-since : Mon, 29
Jun 2020 00:00:00 GMT Object
modified
Otherwise, the object will be HTTP response msg after <date>
sent to client HTTP/1.1 200 OK
<data>

Page 11
Thanks!

工科类 20 号
教师:唐晓岚

Page 12

You might also like