1 / 28

Ric Goell Ming Lei Web Cache Oracle Corporation

Ric Goell Ming Lei Web Cache Oracle Corporation. Web Caching for Database Centric Applications. Outline. Part I - Introduction to Web Caching Part II - Designing with Caching in Mind A process for analyzing the potential for caching benefits Part III – Partial Page Caching with ESI

ansel
Download Presentation

Ric Goell Ming Lei Web Cache Oracle Corporation

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. Ric GoellMing Lei Web Cache Oracle Corporation

  2. Web Caching for Database Centric Applications

  3. Outline • Part I - Introduction to Web Caching • Part II - Designing with Caching in Mind • A process for analyzing the potential for caching benefits • Part III – Partial Page Caching with ESI • Edge Side Includes (ESI) – a standards based technology for page and fragment caching • JESI – A set of JSP tags that support ESI

  4. Part I Why Web Caching? • Content is becoming more dynamic for a richer and more personal Web experience. • The number of people using web based applications is growing beyond the limits of traditional infrastructures. • User expectations are growing – they expect more relevant content and fast response times • Large “Farms” are costly to purchase and manage

  5. Internet/Intranet Caching on the Web $ $ $ $ $ $ $ $ CDN/eCDN Central Data Center Browser Cache Forward Proxy Edge Servers Reverse Proxy Application Server Database

  6. E-Commerce Performance

  7. Cache Hit Rate • Cache hits are practically free when compared to generating dynamic pages. • Focus is on improving cache hit rates.

  8. Why don’t more apps provide caching • “But my pages have too much customization to be cacheable.” • A lame excuse – new tools allow customized and dynamic content to be cached • Page fragments can be assembled • Request and Response Variables can be included • Cache Consistency tools to help with invalidation

  9. Part II: Designing with Caching in Mind • A 3 Step Process • Page Analysis – Determining what to cache • Disambiguation – Key Generation • Cache Consistency – Removing items from cache

  10. Page Analysis When designing a page layout, define fragments with similar cache policies – early in design process • When evaluating the benefit of caching pages or fragments, each of the following should be considered: • Share-ability – How many users share this content? • Generation Cost – How computationally intensive is the generation of this content? • Frequency – How many times will this content be viewed (even within one user’s session) before it changes? • Note that even user specific content may be desirable to cache if it accessed frequently

  11. Disambiguation – Cache Key Definition Differentiating documents based on specific requests. • URLs • Post Body • HTTP Headers • Cookies • MVC Apps tend to have less information in the request. Heavy use of backend state can reduce Web Cache benefits.

  12. Consistency Management • Expiration – Time Based • Invalidation based – explicit message to cache servers to remove content from cache • Validation Based • ETAG and GIMS (similar capabilities for fragments) • Don’t be unnecessarily restrictive

  13. Session State Management • Web Sites often use session keys to track user state and identify data on the server side. • Web Cache was designed to work with sessions by transparently allowing session establishment and updates. • Additionally it was designed to allow for caching of documents that include sessions.

  14. Session Encoded URLs Session Bhttp://store.oracle.com/cec/cstage?session_ID=33437 Session Ahttp://store.oracle.com/cec/cstage?session_ID=33436

  15. Part III PartialPage Caching & Content Assembly • Edge Side Includes (ESI) • an XML-like markup language used to define cacheable and non-cacheable content fragments • a content invalidation protocol for cache consistency • Edge Side Includes for Java (JESI) • a custom tag library to facilitate the use of ESI with JSP applications

  16. Industry Support for ESI An open specification.ESI published as a W3C Note. JESI submitted to JCP as JSR 128.See www.esi.org for more info.

  17. Tag Purpose Used in a “template” page to indicate to the ESI processor how to assembe the fragments (the tag generates the <esi:include> tag. <jesi:include> <jesi:control> Assign an attribute (e.g., expiration) to templates and fragments. Used to contain the entire content of a JSP container page within its body. <jesi:template> <jesi:fragment> Encapsulate individual content fragments within a JSP page. Specify that a particular piece of code needs to be executed before any other fragment is executed. <jesi:codeblock> Explicitly remove and/or expire selected objects cached in an ESI processor. <jesi:invalidate> Insert personalized content into a page where the content is placed in cookies and inserted into the page by the ESI processor. <jesi:personalize> Summary of JESI Tags

  18. JESI Personalization <HTML>Welcome to the Oracle Store <jes:personalize name=”user_name”> ...</HTML> The URL query string has the Personal Valuehttp://Machine:port/zyz?user_name=Jane

  19. What is ESI?

  20. Why ESI? • ESI is in production • Co-developed with Akamai and Oracle • IBM is also implementing ESI • ESI is an open language • Maturing through real usage • W3c note

  21. ESI at a glance • Templates and Fragments • include & inline • Variables • Query String Variables • Cookie Variables • Environment Variables • A good sample App: • http://otn.oracle.com/sample_code/products/ias/web_cache/htdocs/jesi/Readme.html

  22. ESI Personalization <HTML>Welcome to the Oracle Store<esi:vars> $(QUERY_STRING{'user_name'})! </esi:vars> ...</HTML> The URL query string has the Personal Valuehttp://Machine:port/zyz?user_name=Jane

  23. /news101 Template Cache Storage Page Assembly Cache Response /sample.html <esi:include> Model /sample.html (template) <html> ... <esi:include src=”/news101”> ... </html> /news101 <table> ... </table>

  24. /stocks.xml Template Cache Storage Page Assembly Cache Response /sample.html <esi:environment> /sample.html ... <esi:environment src=/stocks.xml name=stock/> ... <esi:vars> ORCL $(stock{orcl_p}) $(stock{orcl_c}) YHOO $(stock{yhoo_p}) $(stock{yhoo_c}) </esi:vars> ... /stocks.xml <orcl_p>8.94</orcl_p> <orcl_c>+0.09</orcl_c> <yhoo_p>16.55</yhoo_p> <yhoo_c>-0.46</yhoo_c>

  25. Template 1 Fragment 1 Fragment 2 Fragment 3 ESI - Storage & Assembly • Parsing is only done the first time a page is fetched. • A buffer array is generated for a scatter/gather network write • This buffer is maintained in the cache for fast cache hits without page assembly processing Buffer Array

  26. ESI Performance • This test measured a real portal application without Web Cache and ESI. • Either the Portal App or Web Cache did the page assembly • 10 portlets

  27. Other Interesting Web Cache Features / Topics • Invalidation / Consistency Management • Expiration based • Invalidation based • Clustering • Cache Hierarchies

More Related