Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Caching: Replication on the World Wide Web Jonathan Bulava CSC8530 – Distributed Systems Dr. Paul Schragger.

Similar presentations


Presentation on theme: "Web Caching: Replication on the World Wide Web Jonathan Bulava CSC8530 – Distributed Systems Dr. Paul Schragger."— Presentation transcript:

1 Web Caching: Replication on the World Wide Web Jonathan Bulava CSC8530 – Distributed Systems Dr. Paul Schragger

2 Types of Web Caches User Agent Cache (Browser Cache) User Agent Cache (Browser Cache) –Single user Shared Cache (Proxy Cache) Shared Cache (Proxy Cache) –Multi-user Gateway Cache Gateway Cache –Multi-user

3 Deployment

4 Browser Cache Implemented on a single user’s machine. Implemented on a single user’s machine. Local hard drive space stores representation of viewed content. Local hard drive space stores representation of viewed content. Simple rules for control. Simple rules for control. Usefulness Usefulness –Recently viewed pages (Back/Forward button) –Commonly used images

5 Proxy Cache Similar concept, but for multiple users. Similar concept, but for multiple users. Usually implemented on a firewall or separate device known as intermediaries. Usually implemented on a firewall or separate device known as intermediaries. Request routing can be manually or through an interception proxy. Request routing can be manually or through an interception proxy. Usefulness Usefulness –Latency and network traffic are reduced

6 Gateway Cache Also known as reverse proxy caches. Also known as reverse proxy caches. Implemented on separate devices by a website administrator. Implemented on separate devices by a website administrator. Distributed gateway caches are used in Content Delivery Networks (CDN). Distributed gateway caches are used in Content Delivery Networks (CDN). Usefulness Usefulness –Increased scalability, reliability, and performance

7 Content Delivery Network (CDN) 3.Get embedded documents 5.Embedded documents 1. Get base documents 2.Document with refs to embedded documents 4a.Get embedded documents from local cache or server (if not already cached) Cache Client CDN server 4b.Embedded documents Original server Cache producer within Akamai CDN

8 Controlling Cache HTML Meta Tags HTML Meta Tags –Written in section of an HTML page. –Can mark expiration date or as uncacheable. –Only used by some browser caches and not seen by proxy caches. HTTP Headers HTTP Headers –Automatically created by Web server. –Sent before HTML. –Seen by browser and proxy caches.

9 HTTP Defining Mechanisms Freshness – Content is able to be loaded from cache without having to check with the original server. Freshness – Content is able to be loaded from cache without having to check with the original server. Validation – The process of confirming with the original server whether or not cached content is still valid to load. Validation – The process of confirming with the original server whether or not cached content is still valid to load.

10 HTTP Response Headers Example HTTP/1.1 200 OK Date: Fri, 30 Oct 1998 13:19:41 GMT Server: Apache/1.3.3 (Unix) Cache-Control: max-age=3600, must-revalidate Expires: Fri, 30 Oct 1998 14:19:41 GMT Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT ETag: "3e86-410-3596fbbc " Content-Length: 1040 Content-Type: text/html Validation Freshness

11 Expires Header and Freshness Indicates how long the representation is fresh. After this time passes, the cache will communicate with the original server to see if there have been any changes. Beneficial for static page images as well as continually changing content. Web server and cache must be synchronized. Expires: Fri, 30 Oct 1998 14:19:41 GMT

12 Cache-Control Header and Freshness Gives control beyond Expires header. Gives control beyond Expires header. Cache-Control: max-age=3600, must-revalidate Cache control response-headers: max-age=[seconds] max-age=[seconds] s-maxage=[seconds] s-maxage=[seconds] public public no-cache no-cache no-store no-store must-revalidate must-revalidate proxy-revalidate proxy-revalidate

13 Last-Modified and Validation Validate cache by looking at the last time the document was altered (Last-Modified). Validate cache by looking at the last time the document was altered (Last-Modified). If-Modified-Since request is sent to the original server. If changes have been made since the date given, the entire document is returned. Otherwise, the cached document can be loaded. If-Modified-Since request is sent to the original server. If changes have been made since the date given, the entire document is returned. Otherwise, the cached document can be loaded. Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT

14 ETag and Validation Unique identifiers created by server. Unique identifiers created by server. Changed each time the representation is altered on the original server. Changed each time the representation is altered on the original server. If-None-Match request is sent to server and a simple comparison is used to validate the content. If-None-Match request is sent to server and a simple comparison is used to validate the content. ETag: "3e86-410-3596fbbc"

15 References Nottingham, Mark. “Caching Tutorial: for Web Authors and Webmasters.” July 2006.. Nottingham, Mark. “Caching Tutorial: for Web Authors and Webmasters.” July 2006.. Tanenbaum, Andrew S. Distributed Systems: Principles and Paradigms. New Jersey: Prentice- Hall, 2002. Tanenbaum, Andrew S. Distributed Systems: Principles and Paradigms. New Jersey: Prentice- Hall, 2002. “Web cache.” Wikipedia.. “Web cache.” Wikipedia..


Download ppt "Web Caching: Replication on the World Wide Web Jonathan Bulava CSC8530 – Distributed Systems Dr. Paul Schragger."

Similar presentations


Ads by Google