Title: Generate Dynamic Content On Cache Server
1Generate Dynamic Content On Cache Server
- Masters Project
- Aparna Yeddula
- Dept. of Computer ScienceUniversity of Colorado
at Colorado Springs
2Outline 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
3Introduction
- 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)
5Related 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
6ESI features
7ESI (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.
8EdgeSuite 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.
9Edge 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.
10ESI 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
11Realize 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.
12JSP (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
13The 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
-
14Cond..
- 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
15Tag 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
16Tag 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
-
17JSP 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
18Servlet 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
20Performance Testbed Set up
Client
Dynamic Cache Server
Web Server
gallop.uccs.edu8888 wait.uccs.edu8080
21Benchmarking 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)
23Impact 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)
25JSP 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 -
26Cont ..
- 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)
28Varying 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)
30Demo
- 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
31Lessons 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
32Future 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.
33Conclusion
- 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.
34References
- 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