Caching Techniquesfor Content Delivery

13
Caching Techniques Caching: 1. Speeds up user access to Web content 2.Reduces network load 3.Reduces origin server load Sanjoy Sanyal:http://www.itforintelligentfolks.blog spot.com/

description

 

Transcript of Caching Techniquesfor Content Delivery

Page 1: Caching Techniquesfor Content Delivery

Caching Techniques

Caching:1. Speeds up user access to Web content 2.Reduces network load3.Reduces origin server load

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 2: Caching Techniquesfor Content Delivery

Basic Operations of a Web Cache

Client Cache SeverHTTP:GET

Stored?Fresh?

HTTP:GET

HTTP:RESPONSE

tSore Copy?

HTTP:RESPONSE NoYes

HTTP:RESPONSE

HTTP:GET

File modified

Caching works on the principle that the client request can be served from the cache Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 3: Caching Techniquesfor Content Delivery

Replacement Rules for Items in the Cache

• Least Recently Used (LRU)

• First In First Out (FIFO)

• Least Frequently Used (LFU)

• Next to Expire (NTE)

• Largest File First (LFF)

These rules can be used to decide which files will be replaced as new items are stored in the cache

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 4: Caching Techniquesfor Content Delivery

Decision to store or serve from the cache

• Cache-Control header field • Cache request directives :

– Whether to use a cached object in without revalidating – Whether to use only cached objects – Whether to store any part of the response – Whether the user will accept responses within age/freshness limits

• Cache response directives– Whether to store or not– Whether to revalidate future requests – Whether to revalidate user credentials before response – When an Object expires

Specified in HTTP protocol

From the client

From the server

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 5: Caching Techniquesfor Content Delivery

Placing a Network in a Cache: Forward Proxy

InternetInternet

Web ServerWeb Clients

Web Cache Forward Proxy

Workgroup LAN

Forward Proxy acts on behalf of content consumersThe Request is first sent over the LAN to the Forward ProxyNetwork administrators set up Forward Proxy to help speed up web access for users

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 6: Caching Techniquesfor Content Delivery

Try This!

• Find out the forward proxy address of your workgroup• Open your Browser • (For IE) Tools>Internet Options>Connections>LAN settings • You can see your Proxy address

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 7: Caching Techniquesfor Content Delivery

Placing a Network in a Cache: Reverse ProxyInternetInternet

Web Servers

Web Clients

Web Cache Reverse Proxy

Sever LAN

Also called sever accelerator Reverse Proxy acts on behalf of origin serverThe Request is sent first to the reverse proxy cache Web Farms set up reverse proxies to improve performance &scalability. Also reverse proxies can be located remotely near customers.

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 8: Caching Techniquesfor Content Delivery

Placing a Network in a Cache: Interception Proxy

InternetInternet

Web Server

Web Clients

Web Cache Interception Proxy

ISP Network

Interception Proxy acts on behalf of the content traffic (the ISP)The Request is first sent over the ISP Network to the Interception ProxyISPs set up Interception Proxy to help speed up web access for customers and reduce wide area bandwidth costs

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 9: Caching Techniquesfor Content Delivery

Cache Techniques for Streaming Media

• Buffering allows for smoothening of multimedia: – It acts as an elastic store with the renderer taking frames from the front of the

buffer at a constant rate – And the network fills the back of the queue at a variable rate – The buffer stores several seconds of the stream trading an initial delay for

smooth rendering – If the stream arriving at the renderer is extremely variable this may lead to

buffer underflow/overflow

Buffer stores several seconds of data

Constant Bit Rate outflowVariable Bit Rate inflow

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 10: Caching Techniquesfor Content Delivery

Delays in Multimedia Streaming

Server Client

Client Request

Playback begins

Connection Delay

Buffer Delay

Total Delay = Connection Delay + Buffer DelaySanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 11: Caching Techniquesfor Content Delivery

Fast Prefix Caching

Server ClientCache

Client Request

To Cache Buffer

From Stored Prefix

From Cache Buffer

ConnectionDelay

Buffer Delay

Playback Begins

Prefix caching reduces the connection delay The client request is served by previously stored multimedia dataLocating the cache close to the client and employing a fast connection reduces the connection delayOther advantage: the cache can serve as a splitter for multiple clients with only one connection to server

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 12: Caching Techniquesfor Content Delivery

Dynamic Caching

Ring Buffer

Server

Client 1

Client 2Patch

t T+

Data for Client 1

Data for Client 2

Start cachingServe Client 2 from Cache

How it works:

Client 2 requests the same streaming object as Client 1

When Client 2 receives start of stream Client 1 has already received seconds of stream

The temporal distance between the clients is

The data streamed to Client 1 is cached in the ring buffer to be served to Client 2

Client 2 is served the initial seconds of stream by a patch from the server or a prefix

T+2Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/

Page 13: Caching Techniquesfor Content Delivery

Summary

• Caching helps in accessing content

• Caching helps in particular in delivering streaming media

• Content delivery networks uses caches at various locations

Sanjoy Sanyal:http://www.itforintelligentfolks.blogspot.com/