Caching
This presentation is the property of its rightful owner.
Sponsored Links
1 / 27

Caching PowerPoint PPT Presentation


  • 100 Views
  • Uploaded on
  • Presentation posted in: General

Caching. Herng-Yow Chen. How caches improve performance and reduce cost How to measure their effectiveness Where to place caches to maximize impact Also explain how HTTP keeps cached copies fresh How caches interact with other caches and servers. Outline. Bandwidth Bottlenecks.

Download Presentation

Caching

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Caching

Caching

Herng-Yow Chen


Outline

How caches improve performance and reduce cost

How to measure their effectiveness

Where to place caches to maximize impact

Also explain how HTTP keeps cached copies fresh

How caches interact with other caches and servers

Outline


Bandwidth bottlenecks

Bandwidth Bottlenecks


Bandwidth imposed transfer time delays idealized time in seconds

Bandwidth-imposed transfer time delays, idealized (time in seconds)


Flash crowds

Flash Crowds


Distance delays

Distance Delays


Hits misses and revalidations

Hits, Misses, and Revalidations

(a) Cache hit

Cache

object

Cache

server

client

(b) Cache miss

Server

object

Server

object

Cache

server

client

(c) Cache revalidate hit

Freshness check

Cache

object

“Still fresh”

Cache

server

client


Revalidations

Revalidations

(a) Revalidate hit (slow hit)

Freshness check

Cache

object

“Still fresh”

Cache

server

client

Server object same as cached copy

(b) Revalidate miss

Freshness check

Server

object

Server

object

Cache

server

client

Cached copy is out of date


Revalidations cont

Revalidations (cont.)

  • Revalidate hit

Revalidate request with If-Modified-Since

GET /announce.html HTTP/1.0

If-Modified-Since: Sat, 29 Jun 2002, 14:30:00 GMT

server

Cache

(browser cache or proxy cache)

HTTP/1.0 304 Not Modified

Date: Wed, 03 Jul 2002, 19:18:23 GMT

Content-type: text/plain

Content-length: 67

Expires: Fri, 05 Jul 2002, 05:00:00 GMT

“Still fresh” response


Three cases in revalidation

Revalidate hit

304 Not Modified response

Revalidate miss

200 OK response, with the full content

Object deleted

404 Not Found response

Three cases in revalidation


Cache performance measurement

Hit Rate (Hit Ratio)

The fraction of requests that are served from cache.

Sometimes it is called document hit ratio.

The hit rate ranges from 0 to 1 but is often described as a percentage, e.g., 0%, 40% (decent) , 100%

Goal: even a modest-sized cache may contain enough popular documents to significantly improve performance and reduce traffic.

Cache Performance measurement


Another metric byte hit rate

Represent the faction of all bytes transferred that were served from cache. This metric captures the degree of traffic savings. (e.g., 100%  no traffic went out across the Internet).

Is preferred by people who are billed for each byte of traffic.

Document hit rate doesn’t tell the whole story, because documents are not all the same size. Some large objects might be accessed less often but contribute more to overall traffic.

Document Hit ratio vs. Byte Hit ratio

Optimize for overall latency reduction. (document hit)

Optimize for bandwidth saving (byte hit)

Another metric: Byte Hit Rate


Cache topologies

Cache Topologies

(a) Accessing private cache

Internet

client

Private cache

Web server

(b) Accessing shared public cache

Internet

client

Web server

Public cache

client


Public proxy caches

Public Proxy Caches

(a) Redundant accesses from private caches

Internet

client

client

Server

client

(b) Shared caches can reduce traffic

Internet

client

client

Server

Cache

client


Proxy cache hierarchy

Proxy Cache Hierarchy


Cache meshes content routing and peering

Cache Meshes, Content Routing, and Peering

X

Y

Origin server

B’s access point

A’s access point

Wide area

network

X

Sibling

Organization A

Organization B


Cache processing steps

Cache Processing Steps


Cache processing flowchart

Cache Processing Flowchart

Request arrives

Cached?

no

yes

Fresh enough?

Revalidated?

no

Revalidate with server

no

Fetch from server

yes

yes

Store into cache

Update freshness

Of cached document

Server to client


Document expiration

Document Expiration

HTTP/1.0 200 OK

Date: Sat, 29 Jun 2002, 14:30:00 GMT

Content-type: text/plain

Content-length: 67

Expires: Fri, 05 Jul 2002, 05:00:00 GMT

Independence Day sale at Joe’s Hardware

Come shop with us today!

HTTP/1.0 200 OK

Date: Sat, 29 Jun 2002, 14:30:00 GMT

Content-type: text/plain

Content-length: 67

Cache-Control: max-age=484200

Independence Day sale at Joe’s Hardware Come shop with us today!

(a) Expires header

(b) Cache-Control:max-age header


Expiration response headers

Expiration response headers


Two conditional headers used in cache revalidation

Two conditional headers used in cache revalidation


If modified since date revalidation

If-Modified-Since : Date Revalidation

Conditional request

GET /announce.html HTTP/1.0

If-Modified-Since: Sat,29 Jun 2002, 14:30:00 GMT

HTTP/1.0 304 Not Modified

Date: Wed, 03 Jul 2002, 19:18:23 GMT

Expires: Fri, 05 Jul 2002, 14:30:00 GMT

client

Server

Response

(a)If-Modifies-Since successful revalidation

Conditional request

GET /announce.html HTTP/1.0

If-Modified-Since: Sat,29 Jun 2002, 14:30:00 GMT

HTTP/1.0 200 OK

Date: Fri, 05 Jul 2002, 14:30:00 GMT

Content-type: text/plain

Content-length: 124

Expires: Mon, 09 Sep 2002, 05:00:00 GMT

All exterior house paint on sale through Labor Day. Just another reason for you to shop this summer at Joe’s Hardware!

client

Server

Response

(b)If-Modifies-Since failed revalidation


If none match entity tag revalidation

If-None-Match:Entity Tag Revalidation

Conditional request

GET /announce.html HTTP/1.0

If-None-Match: “v2.6”

ETag: “v2.6”

ETag: “v2.6”

HTTP/1.0 304 Not Modified

Date: Wed, 03 Jul 2002, 19:18:23 GMT

ETag: “v2.6”

Expires: Fri, 05 Jul 2002, 05:00:00 GMT

Server

Cache

Response


Heuristic expiration

Heuristic Expiration

20% of time between fresh and last modification

(LM-factor=0.2)

Cached copy is fresh for time period

New expiration time

When cache talked to server

Last modified


Cache control request directives

Cache-Control request directives


Http equiv tags cause problems because most software ignores them

HTTP-EQUIV tags cause problems, because most software ignores them


Reference caching

Reference: Caching

  • http://www.w3.org/protocols/rfc2616/rfc2616.txt

    RFC 2616, “Hypertext Transfer Protocol,” by R. Fielding, J. Gettys,

    J.Mongul, H.Frystyk, L.Mastinter, P.Leach, and T.Berners-Lee.

  • Web Caching

    Duane Wessels, O’Reilly & Associates, Inc.

  • http://search.ietf.org/rfc/rfc3040.txt

    RFC 3040, “Internet Web Replication and Caching Taxonomy.”

  • Web Proxy Servers

    Ari Luotinen, Prentice Hall Computer Books.

  • http://search.ietf.org/rfc/rfc3143.txt

    RFC 3143, “Know HTTP Proxy/Caching Problems.”

  • http://www.squid-cache.org

    Squid Web Proxy Cache.


  • Login