Krerk Piromsopa. Web Caching Krerk Piromsopa. Department of Computer Engineering. Chulalongkorn University.

Slides:



Advertisements
Similar presentations
PACS – 06/21/14 1 Cache? What is caching? A way to increase the average rate of a process by preferentially using a copy of data in a faster, closer, probably.
Advertisements

Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
1 Caching in HTTP Representation and Management of Data on the Internet.
HTTP – HyperText Transfer Protocol
HTTP HyperText Transfer Protocol Part 2.
How the web works: HTTP and CGI explained
What’s a Web Cache? Why do people use them? Web cache location Web cache purpose There are two main reasons that Web cache are used:  to reduce latency.
1 The HyperText Transfer Protocol: HTTP Nick Smith Stuart Alley Tara Tjaden.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Hypertext Transport Protocol CS Dick Steflik.
CSC 2720 Building Web Applications Servlet – Getting and Setting HTTP Headers.
Nikolay Kostov Telerik Corporation
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
Mark Phillip markphillip.com 200s, 304s, Expires Headers, HTTP Compression, And You.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
1 Caching  Temporary storage of frequently accessed data (duplicating original data stored somewhere else)  Reduces access time/latency for clients 
Web server. Definition A computer that is responsible for accepting HTTP requests from clients, which are known as Web browsers, and serving them Web.
Human-Computer Interface Course 5. ISPs and Internet connection.
1 HTTP Caching & Cache-Busting for Content Publishers Michael J. Radwin ApacheCon 2005 Wednesday, 14 December 2005.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/10/10.
HTTP Caching & Cache-Busting for Content Publishers Michael J. Radwin O’Reilly Open Source Convention July 28, 2004.
HyperText Transfer Protocol
Java Technology and Applications
HTTP Protocol Specification
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
Web Caching: Replication on the World Wide Web Jonathan Bulava CSC8530 – Distributed Systems Dr. Paul Schragger.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
Traffic Control in Apache Jed Reynolds Blog.Bitratchet.com Where in your web site do you need traffic control?
Proxy Lab Recitation I Monday Nov 20, 2006.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web Server Design Week 4 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/03/10.
1 Caching in HTTP Representation and Management of Data on the Internet.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
HTTP support for caching & replication. Conditional requests Server executes conditional request. Responds with a message body only if the condition is.
A Little Bit About Cookies Fort Collins, CO Copyright © XTR Systems, LLC A Little Bit About Cookies Instructor: Joseph DiVerdi, Ph.D., M.B.A.
1-1 HTTP request message GET /somedir/page.html HTTP/1.1 Host: User-agent: Mozilla/4.0 Connection: close Accept-language:fr request.
Web Cache Consistency. “Requirements of performance, availability, and disconnected operation require us to relax the goal of semantic transparency.”
On The Cooperation of Web Clients and Proxy Caches Yiu Fai Sit, Francis C.M. Lau, Cho-Li Wang Department of Computer Science The University of Hong Kong.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
Web Server Design Week 7 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/24/10.
Web Services. 2 Internet Collection of physically interconnected computers. Messages decomposed into packets. Packets transmitted from source to destination.
A Faster FasterFox? David Backeberg and Remo Mueller.
EE 122: Lecture 21 (HyperText Transfer Protocol - HTTP) Ion Stoica Nov 20, 2001 (*)
5 th ed: Chapter 17 4 th ed: Chapter 21
LURP Details. LURP Lab Details  1.Given a GET … call a proxy CGI script in the same way you would for a normal CGI request  2.This UDP perl.
Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/17/10.
Web Caching. Why Caching? Faster browsing experience for users Cache hit rate Traffic Prioritization Reduce network bandwidth requirements significantly.
Overview on Web Caching COSC 513 Class Presentation Instructor: Prof. M. Anvari Student name: Wei Wei ID:
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Web Server Design Week 5 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 02/07/12.
Fiddler and Your Website Robert Boedigheimer. About Me Web developer since 1995 Columnist for aspalliance.com Pluralsight Author 3 rd Degree Black Belt,
Web Server Design Week 6 Old Dominion University Department of Computer Science CS 495/595 Spring 2006 Michael L. Nelson 2/13/06.
Web Cacheability of CRLs David Groep, Jan 26 th, 2009.
WWW and HTTP King Fahd University of Petroleum & Minerals
Web Development Web Servers.
HTTP request message: general format
Caching Temporary storage of frequently accessed data (duplicating original data stored somewhere else) Reduces access time/latency for clients Reduces.
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Hypertext Transport Protocol
Web Caching? Web Caching:.
Internet Applications
CSE 461 HTTP and the Web.
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
Web Server Design Week 5 Old Dominion University
CSCI-351 Data communication and Networks
Presentation transcript:

Krerk Piromsopa. Web Caching Krerk Piromsopa. Department of Computer Engineering. Chulalongkorn University.

Krerk Piromsopa. What is a Web Cache? A Web cache sits between Web servers (or origin servers) and a client or many clients, and watches requests for HTML pages, images and files (collectively known as objects) come by, saving a copy for itself. Then, if there is another request for the same object, it will use the copy that it has, instead of asking the origin server for it again. There are two main reasons that Web caches are used: –To reduce latency –To reduce traffic

Krerk Piromsopa. Kinds of Web Caches Browser Caches Proxy Caches Since a cache can 'hide' their users from them, making it difficult to see who's using the site.

Krerk Piromsopa. How Web Caches Work 1. If the object's headers tell the cache not to keep the object, it won't. Also, if no validator is present, most caches will mark the object as uncacheable. 2. If the object is authenticated or secure, it won't be cached. 3. A cached object is considered fresh (that is, able to be sent to a client without checking with the origin server) if: –It has an expiry time or other age-controlling directive set, and is still within the fresh period. –If a browser cache has already seen the object, and has been set to check once a session. –If a proxy cache has seen the object recently, and it was modified relatively long ago. –Fresh documents are served directly from the cache, without checking with the origin server. 4. If an object is stale, the origin server will be asked to validate the object, or tell the cache whether the copy that it has is still good.

Krerk Piromsopa. How to Control Caches Meta tags (honored by browser caches) HTTP headers (control over both browser caches and proxies) –HTTP/ OK –Date: Fri, 30 Oct :19:41 GMT –Server: Apache/1.3.3 (Unix) –Cache-Control: max-age=3600, must-revalidate –Expires: Fri, 30 Oct :19:41 GMT –Last-Modified: Mon, 29 Jun :28:12 GMT –ETag: "3e fbbc" –Content-Length: 1040 –Content-Type: text/html

Krerk Piromsopa. HTTP Header Cache Control Pragma HTTP Headers ( Not in HTTP specification) Expires HTTP Header Cache-Control HTTP Headers –max-age=[seconds] –s-maxage=[seconds] (Apply to proxy cache only) –public (cacheable) –no-cache –must-revalidate –proxy-revalidate Cache-Control: max- age=3600, must-revalidate Pragma: no-cache Expires: Fri, 30 Oct :19:41 GMT

Krerk Piromsopa. Building a Cache-Aware Site Refer to objects consistently. Use a common library of images. Make caches store images and pages that don't change often. Make caches recognize regularly updated pages. If a resource (especially a downloadable file) changes, change its name. Don't change files unnecessarily Use cookies only where necessary Minimize use of SSL

Krerk Piromsopa. Writing Cache-Aware Scripts Dump its content to a plain file whenever it changes. Set an age-related header for as far in the future as practical. Make the script generate a validator If you have to use scripting, don't POST unless it's appropriate Don't embed user-specific information in the URL Don't count on all requests from a user coming from the same host

Krerk Piromsopa. PHP & Cache Control <?php Header("Cache-Control: must-revalidate"); $offset = 60 * 60 * 24 * 3; $ExpireString = "Expires: ". gmdate("D, d M Y H:i:s", time() + $offset). " GMT"; Header($ExpireString); ?>

Krerk Piromsopa. ASP & Cache Control

Krerk Piromsopa. Reference