Untitled Document
Table of contents | Next | Previous
Pre-rendering web sites within Lotus Web Content Management
The pre-rendering process takes a snap shot of the entire Lotus Web Content
Management website and saves the site as static HTML files. These static
pre-rendered files can be delivered by the WCM server or by the HTTP web
server. This improves the website delivery performance as the pages are not
dynamically rendered on the fly. This article discusses how to set up and
configure WCM for pre-rendering.
Pre-rendering Introduction
WCM websites can be delivered in the following ways –
- Through the Web Content Management servlet.
- Through a local rendering portlet using the local portal server.
- Through a remote rendering portlet located on a separate portal server.
- Through a pre-rendered site using the local Web server.
The first three methods of delivering a WCM website is commonly known as
dynamic rendering or dynamic delivery as these methods serve content directly
from the WebSphere Portal server. It is possible to take a snapshot of the
entire website as static HTML files. This process is referred to as WCM
pre-rendering and the static website generated is known as the pre-rendered
website.
Delivering a WCM site using the pre-rendered method improves the website
delivery performance as the pages are not dynamically rendered on the fly.
Pre-rendering
The pre-rendering process takes a snap shot of the entire WCM website and
saves the site as static HTML files. These static pre-rendered files can be
delivered by the WCM server or by the HTTP web server. This improves the
website delivery performance as the pages are not dynamically rendered on the
fly.
Consider pre-rendering a website in the following circumstances –
- When the WCM website content does not change very frequently
- When the WCM website content is public
- When the WCM website does not use WebSphere Portal personalization
- The Page navigation component and Search component are not being used in
the WCM website
Before we discuss the configuration options, for reference purpose, we have
included the sections of the
<was_profile_root>/PortalServer/wcm/shared/app/config/wcmservices/WCMConfi
gServices.properties file that are related to the pre-rendering. Please note
that these property values displayed here are taken from a default WCM v6.1
installation environment when no pre-rendering options were configured.
#############################################################################
##
# 3a. Default Module Configuration - START
###############################################################################<
/p>
connect.businesslogic.module.default.class=com.aptrix.pluto.renderer.Rende
rerModule
connect.businesslogic.module.default.remoteaccess=true
connect.businesslogic.module.default.autoload=false
###############################################################################
# 3a. Default Module Configuration - END
###############################################################################
#############################################################################
##
# 3c. Prerendering - BEGIN
###############################################################################<
/p>
# Cacher Module (as default)
#ensure that RendererModule is commented out
#connect.businesslogic.module.default.class=com.aptrix.cacher.CacherModule
#connect.businesslogic.module.default.remoteaccess=true
#connect.businesslogic.module.default.autoload=false
connect.businesslogic.module.cacher.class=com.aptrix.cacher.CacherModule
connect.businesslogic.module.cacher.remoteaccess=true
connect.businesslogic.module.cacher.autoload=false
connect.moduleconfig.cacher.destdir=${WCM_ILWWCM_HOME}/ilwwcm/cacher
connect.moduleconfig.cacher.tempdir=${WCM_ILWWCM_HOME}/ilwwcm/cacher/temp
connect.moduleconfig.cacher.delay=1
connect.moduleconfig.cacher.busydelay=5
connect.moduleconfig.cacher.busystart= 9:00 am
connect.moduleconfig.cacher.busyend= 5:00 pm
connect.moduleconfig.cacher.overwritecache=true
connect.moduleconfig.cacher.defaultcontentname=index.html
connect.moduleconfig.cacher.rendereruser=Anonymous
connect.moduleconfig.cacher.task.cacherurl=http://${WCM_HOST}:${WCM_PORT}/${WCM_
CONTEXT_ROOT}/connect/
connect.moduleconfig.cacher.task.servletpath=/connect
connect.moduleconfig.cacher.task.sites=[SiteA],[SiteB]
connect.moduleconfig.cacher.task.interval.recurrence=10
connect.moduleconfig.cacher.task.interval.startdelay=1
connect.moduleconfig.cacher.task.scheduled.times= 3:00 am
###############################################################################
# 3c. Prerendering - END
###############################################################################<
strong>
| Note: The CacherModule is the module
responsible for pre-rendering WCM websites. |
Configuring pre-rendering
The pre-rendering process can be configured to deliver the WCM website as
static HTML pages in the following two methods –
- Pre-rendered website delivered from the WCM server
- Pre-rendered website delivered from the HTTP web server
Configure Pre-rendering for website delivery from the WCM server
With this option, WCM saves static content as HTML files and dynamic content
is rendered through the WCM server. This helps improve delivery performance.
| Note: You cannot use the WCM local
rendering portlet (Web Content Viewer) when pre-rendering is set as the default
module. |
To configure this option modify the following values in the
WCMConfigServices.properties file -
Ensure that the following line is commented out:
connect.businesslogic.module.default.class=com.aptrix.pluto.renderer.Render
erModule
Ensure that the following line is NOT commented out:
connect.businesslogic.module.default.class=com.aptrix.cacher.CacherModul
e
Users can access the WCM website using the following URL -
http://[host_name]:[port_number]/wps/wcm/connect/[library_name]/
[site_name ]
Configure Pre-rendering for website delivery from the HTTP web server
With this option, WCM saves a snap shot of the entire WCM website as static
HTML files. The pre-render website requires a HTTP web server to deliver the
website content.
To configure this option modify the following values in the
WCMConfigServices.properties file -
Ensure that the following line is NOT commented out:
connect.businesslogic.module.cacher.class=com.aptrix.cacher.CacherModule
Access to the pre-rendered website is available from the HTTP web server and
the URL depends on web server configuration.
Please take care when using connect tags and JSP components when using this
option as they will not be rendered.
The following property values are also required and are described in the
table below.
Property = Value |
Description |
connect.moduleconfig.cacher.destdir=
${WCM_ILWWCM_HOME}/ilwwcm/cacher |
The base directory under which each site
files will be created. There will be one subdirectory created for each site.
Important: If the prerenderer is run with the
connect.moduleconfig.cacher.overwritecache property set to true, any files in
the connect.moduleconfig.cacher.destdir path that were not written in the last
run of the prerenderer will be deleted. For this reason, ensure that the
connect.moduleconfig.cacher.destdir path is only used for storing rendered
content and that it does not contain any other data that cannot be recreated.
|
connect.moduleconfig.cacher.tempdir=
${WCM_ILWWCM_HOME}/ilwwcm/cacher/temp |
The temporary directory that is required to
build the site files prior to moving the data over to the base directory
specified by the connect.moduleconfig.cacher.destdir property. |
connect.moduleconfig.cacher.delay=1
|
This property is used to set the time, in
seconds, between requesting a page while the pre-rendering process is running.
|
connect.moduleconfig.cacher.busydelay=5
|
This property is used to set the time, in
seconds, of the busy delay setting. This is used if executing within the busy
start to busy end period. Otherwise the delay setting (described above) is
used. |
connect.moduleconfig.cacher.busystart= 9:00
am
connect.moduleconfig.cacher.busyend= 5:00 pm |
These settings determine the times between
which the busy delay setting will be used. Enter an absolute time. |
connect.moduleconfig.cacher.overwritecache=true |
If set to true, the prerenderer will
overwrite files in the destdir directory (then delete files that are not
needed). This results in a progressive change in site content as seen by the
user.
If set to false, the first time a site is pre-rendered, the
pre-rendered site files will be added to the destination directory. As changes
are made to the site through the authoring portlet, the new version of the site
will gradually be saved in the temp directory and the old site will remain in
the destination directory. After the pre-renderer has finished saving the site
completely, the contents of the temporary directory are moved to the
destination directory which will then contain both old and new versions of the
pre-rendered site.
Note: A value of false should not be used if a Web
server is used to display the pre-rendered data because some Web servers lock
the data directories. |
connect.moduleconfig.cacher.defaultcontentname=
index.html |
This sets the name of the default or home
file of the site used when accessing the pre-rendered site. This normally would
be index.html. |
connect.moduleconfig.cacher.rendereruser=
Anonymous |
This determines the user to be used to
render the Web Content Management content. Either type Anonymous or
Administrator or a specific user or group name.
The site is pre-rendered based on this user's security rights. If the
user specified here does not have access to a particular component it will not
be pre-rendered. |
connect.moduleconfig.cacher.task.cacherurl=
http://${WCM_HOST}:${WCM_PORT}/
${WCM_CONTEXT_ROOT}/connect/ |
The full URL to be used as the replacement
for the connect servlet in pre-rendered pages. The URL should end with the
string specified in connect.moduleconfig.cacher.task.servletpath if it is not
blank. The context of cacherurl is used when generating a URLvia pre-rendering.
This property is not used when a page belongs to a site that has not already
been pre-rendered at a site level by the scheduled task or via a SRV=cacheSite
request. |
connect.moduleconfig.cacher.task.servletpath=
/connect |
The path of the substituted connect servlet
defined in connect.moduleconfig.cacher.task.cacherurl. This property can be
left blank if the cacherurl context should be used unchanged. |
connect.moduleconfig.cacher.task.sites=
[LibraryA/SiteA],[LibraryB/SiteB],[SiteC] |
The sites within a Web Content Management
environment to pre-render are entered here, separated by commas.
This property provides the option of specifying the library in
addition to the site. If the library is specified, the pre-renderer looks for
the site in that library. If no library is specified, the default library is
used, as specified by the defaultLibrary property in the
WCMConfigService.properties file. |
connect.moduleconfig.cacher.task.interval.recurrence=10
connect.moduleconfig.cacher.task.interval.startdelay=1 |
The CacherModule can be set to run after a
recurring number of minutes.
Recurrence: The recurring period in minutes for a recurring task.
StartDelay: The delay in minutes prior to starting the first
recurring task. |
connect.moduleconfig.cacher.task.scheduled.times=
3:00 am |
Alternately, the CacherModule can be set to
run at certain times. Enter a series of absolute times, separated by commas.
|
Pre-rendering a WCM Website
This section describes the options available to pre-render a WCM website.
The CacherModule can be configured to run automatically or manually.
Automatically running the CacherModule
Specify the following value in the WCMConfigServices.properties file to
configure the CacherModule to run when WCM application is started -
connect.businesslogic.module.cacher.autoload=true
The CacherModule will then run as per the settings configured in the
WCMConfigService.properties file. Use this option to pre-render the WCM
websites on schedule.
| Note: If you have enabled the
cacher module as the default module (i.e. set
connect.businesslogic.module.default.class=com.aptrix.cacher.CacherModule) you
do not need to edit this property as the CacherModule will be started
automatically. |
Manually running the CacherModule
The CacherModule can be manually run to either pre-render the entire WCM
website or to pre-render individual pages. This can be done using the following
URLs -
Service |
Required Parameters
|
Optional Parameters
|
SRV=cacheSite
Initializes prerendering for the given site with a delay as given (in
seconds). |
SITE=<sitename> |
DELAY=<delay>
LIBRARY=<library>
Note: If no library is specified, the default
library is used, as specified by the defaultLibrary property in the
WCMConfigService.properties file |
SRV=flushSiteCache
Clears (flushes) the given site cache. Deletes all pre-rendered data.
|
SITE=<sitename> |
LIBRARY=<library>
Note: If no library is specified, the default
library is used, as specified by the defaultLibrary property in the
WCMConfigService.properties file
SRV=flushPageCache |
SRV=flushPageCache
Flushes the page from the site cache. The site and page are
determined from the request URL. |
|
|
No SRV specified
The CacherModule attempts to retrieve the given page from the cache.
|
|
|
- Pre-render individual WCM pages
http://[host_na
me]:[port_number]/wps/wcm/connect/[library_name]/[site_name]/[site_area_name]/[c
ontent]?MOD=Cacher
Note:
To pre-render individual content items the site specified in the
URL must either be a site set in the WCMConfigService.properties file, or you
must have previously manually pre-rendered the site using
"SRV=cacheSite".
In the URLs above for pre-rendering sites and individual pages,
the library_name parameter is optional. If the library is specified, the
pre-renderer looks for the site in that library. If no library is specified,
the default library is used, as specified by the defaultLibrary property in the
WCMConfigService.properties file. |
Pre-rendering Limitations
This section identifies some of the limitations of using pre-rendering and
will help you identify the right scenario to use this as an option to deliver
WCM websites.
- Pre-rendering takes a snapshot of the WCM website and all users see the
same content. Hence a site that is personalized can't be pre-rendered.
- The path to the content item (including the directory path you are
pre-rendering to - Site/SiteArea/Content) can not exceed the operating system's
maximum path length:
- 255 characters in Microsoft Windows.
- 1024 characters in Linux.
- Invalid Characters in Site, Site Area or Content Names: Sites, Site
Areas, and Content obejcts can not contain characters that are considered
invalid in filenames by the operating system you are prerendering to. E.g. - In
a Microsoft Windows environment, these characters are invalid: / \ : * ? "
< > |
- The pre-rendering process is configured to run as a user
(connect.moduleconfig.cacher.rendereruser ) and hence the website snapshot is
taken as per the access privileges available to the selected user.
- It can take a long time to pre-render a large site and while the site is
being pre-rendered and WCM authoring portlet users may experience being locked
out of the system until the pre-rendering process is completed.
- The entire site must be pre-rendered before it can be used, otherwise
users will experience broken links.
This article discusses how to set up and
configure WCM for pre-rendering.