ESI (Edge Side Includes) Language And Systems - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

ESI (Edge Side Includes) Language And Systems

Description:

ESI is an XML-based markup language and similar to HTML-like markup language ... Akamai, ATG, BEA, IBM, Macromedia, Oracle, Silver Stream, Vignette, and others. ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 23
Provided by: university107
Learn more at: http://cs.uccs.edu
Category:

less

Transcript and Presenter's Notes

Title: ESI (Edge Side Includes) Language And Systems


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

2
(No Transcript)
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
(No Transcript)
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
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
What is available on esi.org?
  • The ESI Web Page http//www.esi.org/, 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 SpecificationThis 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.
  • Edge Architecture SpecificationThis 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
  • ESI Invalidation ProtocolThis specification
    defines the ESI Invalidation Protocol, to allow
    for tight coherence between origin serves and
    surrogates (also know as "Reverse Proxies").
  • JESI Tag Library SpecificationThe 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.
  • News Various news links to articles relating
    to, and about, ESI. And also some examples

8
How many ESI tags are defined?
  • ltesiinclude srcURI altURI
    onerrorcontinue/gt
  • Example
  • ltesiinclude
  • src"http//example.com/1.html"
    alt"http//bak.example.com/2.html"
    onerror"continue"/gt
  • ltesiinclude src"http//example.com/search?query
    (QUERY_STRINGquery)"/gt
  • 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
Cont..
  • ltesiinline nameURIfetchableyesno gt
  • fragment to be stored within an ESI processor
  • lt/esiinlinegt
  • 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
Cont..
  • ltesichoosegt
  • ltesiwhen test"(HTTP_COOKIEgroup)'Advanced'"
    gt ltesiinclude src"http//www.example.com/advance
    d.html"/gt
  • lt/esiwhengt
  • ltesiwhen test"(HTTP_COOKIEgroup)'Basic
    User'"gt ltesiinclude src"http//www.example.com/b
    asic.html"/gt
  • lt/esiwhengt
  • ltesiotherwisegt
  • ltesiinclude src"http//www.example.com/new_user.
    html"/gt
  • lt/esiotherwisegt
  • lt/esichoosegt
  • choose must have at least one when and
    optionally contain exactly
  • one otherwise

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.
  • ltesitrygt
  • ltesiattemptgt
  • ltesicomment text"Include an ad"/gt
  • ltesiinclude src"http//www.ex.com/ad1.html"/gt
  • lt/esiattemptgt
  • ltesiexceptgt
  • ltesicomment text"some HTML instead"/gt
  • lta hrefwww.akamai.comgtwww.example.comlt/agt
  • lt/esiexceptgt
  • lt/esitrygt

12
Cont..
  • ltesicomment text"..." /gt
  • Example
  • ltesicomment text"animation will have a 24 hr
    TTL." /gt
  • 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.
  • ltesiremovegt .. lt/esiremovegt
  • Example
  • ltesiinclude src"http//www.example.com/ad.html"/
    gt ltesiremovegt lta href"http//www.example.com"gtww
    w.example.comlt/agt lt/esiremovegt
  • discarding the remove element and its contents

13
Cont..
  • ltesivarsgt ... lt/esivarsgt
  • Example
  • ltesivarsgt ltimg src"http//www.example.com/(HTTP
    _COOKIEtype)/hello.gif"/ gt
  • lt/esivarsgt
  • To include an ESI variable in markup outside an
    ESI block

14
(No Transcript)
15
Cont ..
  • lt!--esi ...--gt
  • Example
  • lt!--esi ltpgt ltesivarsgtHello,
    (HTTP_COOKIEname)!lt/esivarsgtlt/pgt --gt
  • This is a special construct to allow HTML marked
    up with ESI to render without processing. ESI
    Processors will remove the start ("lt!--esi") and
    end ("--gt") 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
Simple Code
  • ltesitrygt
  • Invalid markup here
  • ltesiattemptgt
  • ltesiinclude ... gt
  • This line is valid and will be processed.
  • lt/esiattemptgt
  • Invalid markup here
  • ltesiexceptgt
  • This HTML line is valid and will be processed.
  • lt/esiexceptgt
  • Invalid markup here
  • lt/esitrygt

17
Example
  1. lthtmlgtltheadgtlttitlegt An example ESI
    templategtlt/titlegtltbodygt
  2. ltesitrygt
  3. ltesiattemptgt
  4. ltesiinclude src"www. mysite.com/myad.html"
    onerror"continue" /gt
  5. lt/esiattemptgt
  6. ltesiexceptgt
  7. Write some HTML for the ad instead
  8. lt/esiexceptgt
  9. lt/esitrygt
  10. static content
  11. lt/bodygtlt/htmlgt

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
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
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
ESI test pages
  • http//gallop.uccs.edu/ayeddula/esi/testesi.html
  •  
  • http//gallop.uccs.edu/ayeddula/esi/home.html
  • http//gallop.uccs.edu/ayeddula/esi/test.html

22
References
  • ESI resource web page http//developer.akamai.com/
    cfcgi/registration.cfm
  • ESI Web Page http//www.esi.org/
  • Edge Side Includes for Java http//www.akamai.com/
    jesi.html
  • Emerging ESI Lower Costs, Better Performance
    http//www.networkcomputing.com/1301/1301ws12.html
Write a Comment
User Comments (0)
About PowerShow.com