Oracle9iAS Web Cache Sample
- Personalized portal is a customizable portal developed to demonstrate
JESI (Edge Server Includes for Java) and Oracle9iAS Web Cache. The
Personalized portal clustering application additionally illustrates the
following Oracle9iAS Web Cache clustering capabilities :-
Content distribution among web
cache cluster members
Content invalidation in web
cache cluster
Greedy Caching
The cache cluster consists of
two or more web cache instances, acting as single logical cache. The content
is cached on each of the cluster member based on the relative capacity.
However, the most popular documents are cached at multiple cluster members.
When the cluster member, which owns the most popular cached document fails,
it can still be served from the other cluster members. This is known as
'greedy caching'. By this mechanism, fewer requests are sent to the
application server, which results in better performance.
The application displays
a login screen at the beginning, to fetch the personal profile of the user
whose information is stored in the database. If the user does not have
a valid login name, the user can sign up to the system. Signing up, creates
a login name and a default profile with default customization for the user.
On successful login, the
application displays two vertically split frames. The right frame is used
to display the portal page and the left page is used to display the statistics.
The statistics page displays the time taken to load the personalized portal
page and list of all configured web cache instances. Each web cache instance
is assigned with particular color while deploying this application and
this color is used to denote the content, cached at this server. The portal
page which is split into multiple fragments, is displayed with the corresponding
color of the web cache instance, where it is initially cached.
To visualize the greedy caching
mechanism of web cache, follow these steps :-
Choose a particular web cache
cluster member other than the web cache instance configured as the load
balancer
Reload the page again
When the page is loaded again,
you could see few fragments still being displayed with the corresponding
color of the stopped web cache instance.
This indicates that those fragments
displayed with the color of the stopped web cache instance, are greedily
cached at other cluster members. When those fragments are invalidated,
the fragment color will be corresponding to one of the colors of available
web cache instance.
About Personalized
Portal Page
The personalized portal page
aggregates contents from different content providers as customized by the
user. The various categories of information available to the user for customization
are
Stocks
Weather
News
Horoscope and
a Todo task list.
In each of these categories,
the user can customize the information that is required. For example, in
the Stocks category, the user can choose the list of stock symbols that
he/she would be interested in. Similarly, the list of news topics in the
news category, the list of cities for weather information in the weather
category and the list of sun sign in the horoscope category. The user can
customize each of these categories by pressing the 'Edit' button displayed
on top of each category. The customized profile for each user will be saved
in the database and used while displaying the content for the user.
The user can customize the
appearance of each of the category of information. Typically, they are:
The heading of the category
The foreground color
of the heading
Color of the content foreground color
The border color
The refresh rate for
this category.
The refresh rate specifies the
time for which the information should be cached in Oracle9iAS Web cache.
The customize link on the
main portal page, displays customizable options of the main page. The user
can select a title for his/her page, color for the heading and content,
user's first name and last name. The user can also customize the page layout
of his/her portal page. The portal page is divided into 3 columns. The
user can specify the columns to which their category of information should
get into. If the user is not interested in any particular category of information,
they can choose to remove that particular category.
Role of Oracle9iAS
Web Cache
This section describes the role
of Oracle9iAS Web Cache, in the personalized portal page. Each of
the category of information displayed in the portal page is a fragment,
which we call as a 'category fragment'. The main personalized portal page
displayed to the user is a template which consists of these fragments.
Each of the category fragment is broken into sub fragments. For example,
each of the stock symbol information within the stock category is a sub
fragment. The category fragment is cached for every user, since its appearance
changes for every user. The sub fragments carry the same information for
every user and they are cached at global level and these sub fragments
are available to all users. The expiration time of the category fragment,
the refresh rate, is customizable for every user. And the expiration of
the sub fragments can be set at the application level.
The time stamp is displayed
for every category, which indicates when the content was actually generated.
When the particular category of information for the user is fetched from
the cache, the time stamp displayed in the sample version with cache will
vary with the sample version that does make us of cache. This indicates
that the content was generated some time earlier. The update link at the
end of each category invalidates that particular category of information
alone in the cache and would aggregate all the other content from the cache
itself. This is to ensure that the response time is quicker even when some
fragments in the page has been invalidated.
When the user customizes
a category of information, only that particular category is invalidated
in the cache version of the application. So, the next request for the portal
page has to fetch this information alone and all the other categories of
information will be fetched from the cache itself. This can be checked
by customizing the layout of the page or by customizing any category information.
The application without cache, would have taken a longer time to fetch
the data since even for a small change like this, the page has to be built
all over from scratch. This includes aggregating the content from all content
providers and assembling them.
Oracle9iAS Web Cache
ensures scalability for an increasing user base by caching frequently requested
data in the cache and serving the users from the cache itself. For
example, if the stock symbol ORCL
is requested by many users, this
quote sub fragment will be requested only once from the application server
and will be cached to serve subsequent requests. This reduces the load
on the server.
To check the cache contents
in the Oracle9iAS Web Cache, click the View Cache Contents link
in the main portal page or use Oracle9iAS Web Cache Admin tool.
Screen shots of
the Sample Application
Figure 1. Personalized Portal Page for user Scott
The page is split into two parts,
the left side displays the clock, list of all configured web cache instances
and their colors. The right side contains the portal page, each fragment
in the portal is displayed with color of the web cache instance, where it
is being cached.
Figure 2. Content Distribution graph
This figure below displays the
content distribution graph. By clicking on each pie, the details of the
esi fragments in that web cache instance can be viewed.
Version dependencies
This sample application has
been tested against the Oracle9iAS Containers for Java 9.0.2.0 and Oracle9iAS
Web Cache Release 9.0.2
Installation and
Configuration
Refer to Install.html
for step-by-step instructions on copying files, installing packages, and
other configurations to successfully run the sample.
Directory
Filename
Description
src\
MyPortal.properties
Property file which contains
specific details about the Web Cache server , database server , Application
server etc., This file should be modified specific to user environment
before deploying this sample.
doc\
Readme.html
This file
Install.html
This file has instructions
required to install the software and run this sample.
src\oracle\otnsamples\webcachemyportal\
ConnectionParams.java
This java file stores
the database connection parameters, Oracle9iAS Web Cache Server
parameters, Oracle9iAS parameters, Application specific parameters.
MyPortalBean.java
This Bean contains the
business logic of the system.
Appearance.java
This class is the java
object representaion of user customized appearance.
MyPortalGraphBean.java
This class is used to
draw the content distribution graph.
ImageServlet.java
This Servlet is used
to render the Graph Image on the Graph.jsp page.
WebCacheServer.java
This class is the object
representation of the configured web cache instances.
public_html\
CachedHoroscope.jsp
This JSP is the Horoscope
fragment.
CachedNews.jsp
This JSP is the News
fragment
CachedStocks.jsp
This JSP is the Stocks
fragment.
CachedTodo.jsp
This JSP is the Todo
task fragment.
CachedWeather .jsp
This JSP is the Weather
fragment.
CustomizeContent.jsp
This JSP customize fragment
appearance, content, layout and other customizable things.
EditTodo.jsp
This JSP Add/edit/delete
Todo task for the user.
Invalidate.jsp
This JSP invalidates
the category fragment of the user.
Login.jsp
This JSP is the login
page of the system.
Signup.jsp
This JSP allows user
to sign-up to the system.
Start.jsp
This JSP starts the request
to both with cache and without cache version of the portal page.
Main.jsp
This JSP is the template
for the portal page.
Graph.jsp
This JSP is used to display
the content distribution graph
Calendar.js
This javascript displays
calendar.
colorpicker.java
This is color picker
applet.
images
This directory holds
images used in the system.
/sql
tables.sql
SQL script, which creates
tables and populates these tables for the application.
/
MyPortalCluster.jpr
JDeveloper Project File
MyPortalCluster.jws
JDeveloper WorkSpace
File
MyPortalCluster.deploy
Deployment File
build.xml
This XML file is used
by ANT to create the application ear file