Presentation is loading. Please wait.

Presentation is loading. Please wait.

AparnaESI Language 1 ESI (Edge Side Includes) Language And Systems By Aparna Yeddula.

Similar presentations

Presentation on theme: "AparnaESI Language 1 ESI (Edge Side Includes) Language And Systems By Aparna Yeddula."— Presentation transcript:

1 AparnaESI Language 1 ESI (Edge Side Includes) Language And Systems By Aparna Yeddula

2 Aparna ESI Language 2

3 Aparna ESI Language 3 ESI Language Specification1.0 ESI is an XML-based markup language and similar to HTML-like markup language used to isolate dynamic page elements such as stock quotes and rotating banners for compilation at the "edge" ESI is designed to leverage client tools like caches to improve end-user perceived performance. Advantage: Reduce processing overhead on the origin server ESI allows for dynamic content assembly at the edge of the network ESI enables Web pages to be broken down into fragments of differing cacheability profiles. Each fragment is treated as separate entity. Cached templates and fragments may be shared among multiple users ETS: ESI Test Server Sniptes: ESI includes points to HTML files, but they are not full HTML web pages, they are just small HTML portions that fit within a web page

4 Aparna ESI Language 4

5 Aparna ESI Language 5 ESI The Origin server is the existing web-server. The ETS server now sits in- between the origin server and the user. The ETS server processes requests from the user and determines what parts of the page need to be retrieved from the Origin server. This is determined based on caching requirements and TTL(Time To Live) settings for each ESI tag. ETS is configured with the IP address and port for the Origin test server, thus allowing it to transparently forward requests and retrieve content, without disruption to the Origin server or web browser functions. Although the previous diagram shows that ETS and the origin test server are running on separate machine, you can install ETS on the same machine as the origin test server.

6 Aparna ESI Language 6 ESI Features ESI tags keep dynamic content fresh with much less stress on the web server. ESI invalidation protocol offers the methods used to invalidate (expire)data on the edge by the origin server. Architecture spec. details the use of HTTP intermediaries to control content. JESI tag library spec. is intended to be convenient JSP application-level interface to the ESI tags for web caching functionality. Its purpose is to help in the use of ESI tags within a JSP application.

7 Aparna ESI Language 7 What is available on The ESI Web Page contains the following information: – Overview – An introduction to ESI including the technical advantages of ESI – Endorsers – Various companies that endorse ESI, such as Akamai, ATG, BEA, IBM, Macromedia, Oracle, Silver Stream, Vignette, and others. – Specifications ESI Language Specification This specification defines ESI 1.0, the Edge Side Includes language, which allows content assembly by HTTP surrogates, by providing an in-markup XML-based language. ESI Language Specification Edge Architecture Specification This document defines the Edge Architecture, which extend the Web infrastructure through the use of HTTP surrogates - intermediaries that act on behalf of an origin server Edge Architecture Specification ESI Invalidation Protocol This specification defines the ESI Invalidation Protocol, to allow for tight coherence between origin serves and surrogates (also know as "Reverse Proxies"). ESI Invalidation Protocol JESI Tag Library Specification The Java ESI tag library is intended to be the convenient JSP application-level interface to the ESI tags for web caching functionality. Its purpose is to facilitate the use of ESI tags within a JSP application. JESI Tag Library Specification – News – Various news links to articles relating to, and about, ESI. And also some examples

8 Aparna ESI Language 8 How many ESI tags are defined? Example:  “ include ” element specifies a fragment for assembly.  it does not have a closing tag.  “ include ” statement tells ESI processors to fetch the resource specified by the src attribute.  If src not found, then fetch the “ alt ” alternative resource.  “ onerror ” attribute will delete the “ include ” element silently.

9 Aparna ESI Language 9 Cont.. fragment to be stored within an ESI processor  The esi processor will parse response and extract all “ inline ” fragments and store them independently, under the URI specified.  Some “ inline ” fragments are only delivered as part of an HTTP response for another object.

10 Aparna ESI Language 10 Cont.. “ choose ” must have at least one “ when ” and optionally contain exactly one “ otherwise ”

11 Aparna ESI Language 11 Cont.. Exception handling is provided by the “try” element must contain exactly one instance of both an “attempt” and an “except” Statements other than “include” and “inline” will not trigger this error.

12 Aparna ESI Language 12 Cont.. Example:  The “comment” element allows developers to comment their ESI instructions.  “Comments” are not evaluated by ESI Processors; they are deleted before output. Comments that need to be visible in the output should use standard XML/HTML comment syntax... Example:  discarding the remove element and its contents

13 Aparna ESI Language 13 Cont..... Example:  To include an ESI variable in markup outside an ESI block

14 Aparna ESI Language 14

15 Aparna ESI Language 15 Cont.. Example: Hello, $(HTTP_COOKIE{name})! -->  This is a special construct to allow HTML marked up with ESI to render without processing. ESI Processors will remove the start (" ") when the page is processed, while still processing the contents. If the page is not processed, it will remain, becoming an HTML/XML comment tag  This assures that the ESI markup will not interfere with the rendering of the final HTML if not processed.

16 Aparna ESI Language 16 Simple Code Invalid markup here This line is valid and will be processed. Invalid markup here This HTML line is valid and will be processed. Invalid markup here

17 Aparna ESI Language 17 Example 1. An example ESI template> Write some HTML for the ad instead static content 11.

18 Aparna ESI Language 18 Look at these lines to examine how ESI works Line 2: This ESI tag specifies that the ESI processor should try to include some dynamic content. The only valid subtags, or children, of the try tag are attempt and except. Developers may notice that this closely resembles the try..catch..finally pattern of exception handling in languages such as Java and C++. Lines 3, 4 and 5: These tags instruct the processor to attempt to fetch a fragment. Note that the tag is properly closed as per XML document rules. The onerror attribute of the include tag instructs the ESI processor to gracefully delete the error message that may be returned and to continue processing the page. Lines 6, 7 and 8: These tags indicate what action should occur if the fragment specified in the attempt tag cannot be loaded. Line 9: Again, the try tag is properly closed. Lines 10 and 11: Other content, including additional fragments or native markup, may be included.

19 Aparna ESI Language 19 Lessons Learned – Configuration Issues The ETS server acts as an intermediary between the client and the web server. My original thought was that the existing web server would reference out to the ETS server for the necessary ESI tags. Actually the opposite is true, the ETS server references out to the Origin web server. For configuration purposes this means that the HTML code needs to resided on the Origin(main) web server NOT on the ETS server Additionally the HTML snippets referenced by the ESI include tags need to reside on the Origin web server or any other server referenced by the ETS server.

20 Aparna ESI Language 20 Setting up/testing the demo/servers The Windows Version of the ETS server was not working. So what we have done was, we took the Linux Version of the ETS server and the “origin” server remain same(Windows2000 advanced server). In the Linux Version - To extract the installation files from the tar file tar xzvf ETS_1.0Beta3_Linux.tar.gz - Start install “./install” on installation make sure on port 80 there is no web server running. And set the origin server and its port number. My installation was not successful as it was running web server on port 80. So go to the directory./usr/local/ETS/bin at the prompt enter./ets_config. And make sure you also make changes in the./etc/httpd/conf/httpd.conf file. To start the ETS server go to directory./usr/local/ETS/bin and enter “apachectl start” and to stop enter “apachectl stop”

21 Aparna ESI Language 21 ESI test pages

22 Aparna ESI Language 22 References ESI resource web page ESI Web Page Edge Side Includes for Java Emerging ESI: Lower Costs, Better Performance

Download ppt "AparnaESI Language 1 ESI (Edge Side Includes) Language And Systems By Aparna Yeddula."

Similar presentations

Ads by Google