Generate Dynamic Content On Cache Server - PowerPoint PPT Presentation

About This Presentation
Title:

Generate Dynamic Content On Cache Server

Description:

The ESI assembly model is comprised of a template containing fragments. ... Like each fragment has its own time-to-live (TTL) attribute. ... – PowerPoint PPT presentation

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

less

Transcript and Presenter's Notes

Title: Generate Dynamic Content On Cache Server


1
Generate Dynamic Content On Cache Server
  • Masters Project
  • Aparna Yeddula
  • Dept. of Computer ScienceUniversity of Colorado
    at Colorado Springs

2
Outline of the Talk
  • Introduction to Dynamic Cache Server(DCS)
  • Related Literature
  • ESI (Edge Side Include) Language Akamais
    solution to how a web page be dynamically
    generated.
  • JSP/Servlet use of customized JSP tags with
    servlets to realize subset of ESI tags in a DCS.
  • Performance Comparison between ETS and JDCS (Java
    Dynamic Cache Server)
  • Lessons Learned
  • Future Directions
  • Conclusion

3
Introduction
  • Caching.
  • Web proxy server.
  • Advantage With caching Faster, not consume
    Internet bandwidth.
  • Disadvantage With out caching heavy burden on
    original server.
  • Serving Static pages
  • What data its handling and what time to refresh
    data.
  • Serving Dynamic pages
  • Distinguish dynamic portions and static, know
    where to find dynamic data.
  • Most cache server did not provide such services.
  • Solution Akamai had proposed Edge Side Include
    (ESI) language, provide solution for dynamic
    caching.

4
(No Transcript)
5
Related Literature
  • Active Cache Wisconsins Java Cache Server.
    http//www.cs.wisc.edu/cao/papers/active-cache/SE
    CTION00100000000000000000
  • ETS http//www.esi.org
  • CDN Akamai, Digital Island http//www.akamai.com/
    index_flash.html

6
ESI features
7
ESI (Edge Side Include) Language
  • ESI is an XML-based markup language and similar
    to HTML-like markup language.
  • The ESI assembly model is comprised of a template
    containing fragments.
  • The template is the container for assembly.
  • Each fragment is treated as separate entity.
  • ESI enables Web pages to be broken down into
    fragments of differing cache-ability profiles.
    Like each fragment has its own time-to-live (TTL)
    attribute.
  • Advantage Reduce processing overhead on the
    origin server.

8
EdgeSuite overview
  • Akamai EdgeSuite move web content to the edge of
    the internet.
  • Allowing dynamic content assembly at the edge of
    the network.
  • Intelligent routing technology.
  • EdgeSuite is a complete outsourced solution that
    delivers the content.

9
Edge side include Test Server (ETS)
  • ETS is available from Akamai. http//akamai.com
  • The ETS server now sits in-between the origin
    server and the user.
  • Each fragment of the page needs to be retrieved
    from the origin server.
  • The ETS server determines which parts of the page
    need to be retrieved from the Origin Server.
  • We can install ETS on the same machine as the
    origin test server.

10
ESI Example
  • ltesiincludegt tag example
  • For example,
  • ltesiinclude src"http//example.com/1.html"
    ttl1hr/gt
  • ltesichoosegt tag example
  • For example,
  • ltesichoosegt
  • ltesiwhen test"(HTTP_HOST)128.198.192
    .174'"gt
  • ltesiinclude src"http//www.example.com/advance
    d.html"/gt
  • lt/esiwhengt
  • ltesiotherwisegt
  • ltesiinclude src"http//www.example.com/newuser
    .html"/gt
  • lt/esiotherwisegt
  • lt/esichoosegt

11
Realize DCS using JSP/Servlet
  • ETS free version does not implement TTL, DataBase
    support
  • We explored the use of Customized JSP Tag with
    servlets.
  • Allows us to investigate the performance issues
    in Dynamic Cache Server Design.

12
JSP (Java Server Pages) custom tag specifications
  • To use the JSP custom tags, we need to define
    three separate components
  • JSP file.
  • tag library descriptor (tld).
  • tag handler class.

simple-taglib.tld ltnamegthellolt/namegt lttagclassgt c
wp.tags.HelloWorldTag lt/tagclassgt
  • Helloworld.jsp
  • lt_at_ taglib
  • uri"simple-taglib.tld
  • prefix"jspx" gt
  • ltjspxhello /gt

HelloWorldTag.java public class HelloWorldTag
extends TagSupport
13
The JSP file
  • lt!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN"gt
  • lthtmlgt
  • ltheadgt
  • lt_at_ taglib uri"simple-taglib.tld prefix"jspx"
    gt
  • lttitlegtltjspxhello /gtlt/titlegt
  • lt/headgt
  • ltbodygt
  • ltjspxhello /gt
  • ltjspxhellogt body tag ltjspxhello/gt

14
Cond..
  • ltjspxdatabase month"lt strmnt1gt" /gt
  • ltjspxifgt
  • ltjspxconditiongtlt request.getRemoteAddr()
    gtlt/jspxconditiongt
  • ltjspxthengt
  • ltjspxinclude uri"http//gallop.uccs.edu
    8888/1.html" ttl"1"/gt
  • lt/jspxthengt
  • ltjspxelsegt
  • ltjspxinclude uri"http//gallop.uccs.edu/2.
    html" ttl"1"/gt
  • lt/jspxelsegt
  • lt/jspxifgt

15
Tag library descriptor file
  • lt!DOCTYPE taglib PUBLIC "-//Sun Microsystems,
    Inc.//DTD JSP Tag Library 1.1//EN"
  • "http//java.sun.com/j2ee/dtd/web-jsptaglibrary_1
    _1.dtd"gt
  • lttaglibgt lttaggt
  • ltnamegthellolt/namegt
  • lttagclassgtcwp.tags.HelloWorldTaglt/tagclassgt
  • lt/taggtlttaggt
  • ltnamegt database lt/namegt
  • lttagclassgtcwp.tags.DataBaseTaglt/tagclassgt
  • ltattributegt
  • ltnamegtmonthlt/namegt
  • ltrequiredgttruelt/requiredgt
  • lt/attributegt
  • lt/taggt lt/taglibgt

16
Tag handler class
  • import javax.servlet.jsp.
  • import javax.servlet.jsp.tagext.TagSupport
  • public class HelloWorldTag extends TagSupport
  •   public int doStartTag()
  • JspWriter out pageContext.getOut()
  • out.println("lttrgtlttdgt Hello World
    lt/tdgtlt/trgt")
  • public int doEndTag()
  • if return EVAL_BODY_TAG
  • else return SKIP_BODY

17
JSP Example
  • JSP FILE
  • ltbodygt
  • lt_at_ taglib uri"include-taglib.tld"
    prefix"jspx" gt
  • ltjspxinclude uri"http//uccs.edu/page.html"
    ttl"1"/gt
  • lt/bodygt
  • TLD FILE
  • ltnamegtincludelt/namegt lttagclassgtcwp.tags.Include
    Taglt/tagclassgt
  • ltattributegt ltnamegturilt/namegt
    ltrequiredgttruelt/requiredgtlt/attributegt
  • ltattributegt ltnamegtttllt/namegt
    ltrequiredgttruelt/requiredgtlt/attributegt

18
Servlet Implementation for retrieving attributes
from JSP page
  • public int doStartTag() throws JspException
  • public void setUri (String name)
  • uriName name
  • public void setTtl (String name)
  • ttlName name

19
Implementing Proxy Caching

20
Performance Testbed Set up
Client
Dynamic Cache Server
Web Server
gallop.uccs.edu8888 wait.uccs.edu8080
21
Benchmarking Results Compare ETS and JDCS
  • Result - 1 ESI template page containing HTML
    fragments
  • Template page http//gallop.uccs.edu/ayeddula/esi
    /esitag.html
  • Fragments are
  • 1. http//gallop.uccs.edu8888/examples/staticpage
    .html ttl"5 Seconds"
  • 2. http//gallop.uccs.edu/ayeddula/tasks.html
    ttl"5 Seconds"
  • Result - 2 JSP Custom tag page containing HTML
    fragments
  •  
  • Template page http//gallop.uccs.edu8888/example
    s/IncludeTag.jsp
  • Fragments in the page are
  • 1. http//gallop.uccs.edu8888/examples/staticpage
    .html ttl"5 Seconds"
  • 2. http//gallop.uccs.edu/ayeddula/tasks.html
    ttl"5 Seconds"

22
(No Transcript)
23
Impact when increase in file size
  • Result - 1 ESI template page containing html
    fragments
  • Template page http//gallop.uccs.edu/ayeddula/es
    i/testesi.html
  • Fragments are
  • http//gallop.uccs.edu8888/examples/staticpage.ht
    ml ttl"5 Seconds"
  • http//gallop.uccs.edu/ayeddula/tasks.html
    ttl"5 Seconds"
  •  
  • Result - 2 JSP custom tag page containing html
    fragments
  • Template page http//gallop.uccs.edu8888/exampl
    es/IncludeTag1.jsp
  • Fragments are
  • http//gallop.uccs.edu8888/examples/staticpage.ht
    ml ttl"5 Seconds"
  • http//gallop.uccs.edu/ayeddula/tasks.html
    ttl"5 Seconds"

24
(No Transcript)
25
JSP with JDBC-ODBC access
  • JSP custom tag page containing html fragments
  •  
  • Template page http//gallop.uccs.edu8888/example
    s/database.jsp
  • Fragments are
  • JSP file include database tag
  • ltjspxdatabase month"lt strmnt1gt" /gt
  • TLD file
  • ltnamegtdatabaselt/namegt lttagclassgtcwp.DataBaselt/
    tagclassgt
  • ltattributegt ltnamegtmonthlt/namegt
    lt/attributegt

26
Cont ..
  • import javax.servlet.jsp.tagext.TagSupport
    import java.sql.
  • public class DataBase extends TagSupport
  • public int doStartTag() throws JspException
  • Connection connull Statement stmtnull
    ResultSet rsnull
  • Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
  • conDriverManager.getConnection("jdbcodbcayedd
    uladb",null,null)
  • stmtcon.createStatement()
  • rsstmt.executeQuery("select date,text from "
    getMonth )
  • while(rs.next()) pageContext.getOut().prin
    tln( rs.getString(1)
  • return SKIP_BODY public void
    setMonth(String strMonth)
    getMonthstrMonth

27
(No Transcript)
28
Varying TTL implementation
  • JSP custom tag page containing html fragments
  •  
  • Template page
  • http//gallop.uccs.edu8888/examples/IncludeTag2.
    jsp
  • The test four Fragments are
  • http//gallop.uccs.edu8888/examples/staticpage.ht
    ml ttl"60 Seconds"
  • http//gallop.uccs.edu/ayeddula/tasks.html
    ttl"120 Seconds"

29
(No Transcript)
30
Demo
  • ESI 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
  • http//gallop.uccs.edu/ayeddula/esi/conditionesi.h
    tml
  • JSP Pages
  • http//gallop.uccs.edu8888/examples/IncludeTag.js
    p
  • http//gallop.uccs.edu8888/examples/IfExample.jsp
  • http//gallop.uccs.edu8888/examples/database.jsp

31
Lessons Learned
  • The ETS server acts as an intermediary between
    the client and the web server.
  • HTML code needs to reside on the Origin(main) web
    server NOT on the ETS server.
  • Servlet can not read complete cookie data
    triggered through JSP tags.
  • It is difficult to implement Time-To-Live
    feature.
  • The url in the tag library descriptor should use
    . notation instead of /
  • cwp.tags.IncludeTag not cwp/tags/IncludeTag
  • The tag library descriptor reads only the
    packages but not direct class handler.
  • cwp.tags.IncludeTag not IncludeTag

32
Future Directions
  • Extend ESI tags to include functions such as
    filtering and merging data, transforming of
    fragments.
  • Enable displaying of fragments at different
    layout locations.
  • Explore the load balancing features of ESI.

33
Conclusion
  • Designed and implemented Database tags, ESI
    include and conditional tags using customized
    JSP tags and servlets.
  • Compared the performance of JDCS and that of ETS.
  • Generated dynamic web pages on cache servers
    which conserve bandwidth.
  • Generated dynamic web pages on cache server with
    rotating advertisement.

34
References
  • 1 Active Cache Caching Dynamic Contents on
    the Web http//www.cs.wisc.edu/cao/papers/ac
    tive-cache/SECTION00100000000000000000
  • 3 ESI Resources http//www.esi.org/language_sp
    ec_1-0.html
  • 4 Core Servlets and Java Server Pages by
    Marty Hall
  • 5 Core Web Programming by Marty Hall and
    Larry Brown
Write a Comment
User Comments (0)
About PowerShow.com