1 / 15

Web Caches and CGI

Web Caches and CGI. user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns object else cache requests object from origin server, then returns object to client. HTTP request. HTTP request. HTTP response. HTTP response.

acraig
Download Presentation

Web Caches and CGI

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Caches and CGI

  2. user sets browser: Web accesses via cache browser sends all HTTP requests to cache object in cache: cache returns object else cache requests object from origin server, then returns object to client HTTP request HTTP request HTTP response HTTP response HTTP request HTTP response Web caches (proxy server) goal: satisfy client request without involving origin server proxy server client origin server client origin server Application Layer

  3. cache acts as both client and server server for original requesting client client to origin server typically cache is installed by ISP (university, company, residential ISP) why Web caching? reduce response time for client request reduce traffic on an institution’s access link Internet dense with caches: enables “poor” content providers to effectively deliver content (so too does P2P file sharing) More about Web caching Application Layer

  4. Caching example: assumptions: • avg object size: 100K bits • avg request rate from browsers to origin servers:15/sec • avg data rate to browsers: 1.50 Mbps • RTT from institutional router to any origin server: 2 sec • access link rate: 1.54 Mbps consequences: • LAN utilization: 15% • access link utilization = 99% • total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + usecs origin servers public Internet problem! 1.54 Mbps access link institutional network 1 Gbps LAN Application Layer

  5. Caching example: fatter access link assumptions: • avg object size: 100K bits • avg request rate from browsers to origin servers:15/sec • avg data rate to browsers: 1.50 Mbps • RTT from institutional router to any origin server: 2 sec • access link rate: 1.54 Mbps consequences: • LAN utilization: 15% • access link utilization = 99% • total delay = Internet delay + access delay + LAN delay = 2 sec + minutes + usecs origin servers public Internet 154 Mbps 1.54 Mbps access link 154 Mbps 0.99% institutional network 1 Gbps LAN msecs Cost: increased access link speed (not cheap!) Application Layer

  6. Caching example: install local cache local web cache assumptions: • avg object size: 100K bits • avg request rate from browsers to origin servers:15/sec • avg data rate to browsers: 1.50 Mbps • RTT from institutional router to any origin server: 2 sec • access link rate: 1.54 Mbps consequences: • LAN utilization: ? • access link utilization = ? • total delay = Internet delay + access delay + LAN delay = ? + ? + ? origin servers public Internet 1.54 Mbps access link institutional network 1 Gbps LAN Cost: web cache (cheap!) Application Layer

  7. Goal: don’t send object if cache has up-to-date cached version no object transmission delay lower link utilization cache: specify date of cached copy in HTTP request If-modified-since: <date> server: response contains no object if cached copy is up-to-date: HTTP/1.0 304 Not Modified HTTP response HTTP/1.0 304 Not Modified Conditional GET server client HTTP request msg If-modified-since: <date> object not modified before <date> HTTP request msg If-modified-since: <date> object modified after <date> HTTP response HTTP/1.0 200 OK <data> Application Layer

  8. CGI – Common Gateway Interface

  9. Need for CGI • HTML/XHTML is static, it is not parameterized; • using only HTML/XHTML, CSS and JS one can not write dynamic web pages: pages that look differently depending on the user who visit it (client, administrator etc.), pages that display different products depending on what is in a database, pages that should be displayed depending on the value of some parameters. • using only HTML/XHTML, CSS and JS one can not develop distributed web applications (e-commerce sites, hotel booking, web search applications etc.)

  10. What is CGI? • Common Gateway Interface (CGI) is a standard method used to generate dynamic content on Web pages and Web applications. CGI, when implemented on a Web server, provides an interface between the Web server and programs that generate the Web content. TransportLayer

  11. What is CGI? • a standard protocol for interfacing external application software with the web server • developed in 1993 at NCSA (National Center for Supercomputing Applications) • CGI 1.1 specified in RFC 3875, 2004 • allows an external executable file to respond to an HTTP Request from the browser • CGI defines how information is passed from the web server to the executable program and how information is passed from this back to the server

  12. Server-side web programming • the HTTP Response consists of the output of an exernal program located on the server machine: HTTP Request Server-side Request HTTP Response Response Header + Html file browser executable file/CGI, php file, jsp file, asp file web server

  13. Relative Programs and Files Web server Client Script Form CGI program

  14. CGI and Database

  15. Questions These slides are adapted from Computer Networking: A Top Down Approach Jim Kurose, Keith RossAddison-WesleyMarch 2012

More Related