This article outlines best-practices and patterns for IBM Lotus Workplace Web Content Management (WCM) pre-rendering based on first-hand experiences from successful projects using Agile software development methodologies.
WCM pre-rendering is used to create static HTML content from WCM libraries served through highly-performant and scalable web server farms that do not require the dynamic content delivery capabilities of the WCM “Connect” Servlet. The WCM CacherModule is used to pre-render a site or content item and can be configured to run automatically at pre-defined times in addition to being a process that can be manually invoked by a user.
The following topics are covered in this article:
- Limitations of WCM pre-rendering
- WebSphere Portal deployment patterns
- WebSphere Portal configuration for WCM pre-rendering
- Output modalities
- Manually pre-rendering a library/site
- Manually pre-rendering a content item
- Security context for pre-rendering
- Content transfer to HTTP servers
- WCM pre-render performance tuning
- Frequently Asked Questions
All configuration and examples shown are based on an installed version of IBM WebSphere Portal 18.104.22.168.
Limitations of WCM pre-rendering
To begin with, it is important to understand the limitations of WCM pre-rendering:
- Sites, site areas, and content items can only contain characters that are valid in file names for the operating system on which you are pre-rendering.
- The path to the content item (inclusive of the directory path where files are pre-rendered to) cannot exceed a length of 255 characters in Windows or 1024 characters on Unix.
- JSP components cannot be pre-rendered.
- Pre-rendered content will contain the portal context root URL (i.e. /wps/wcm/connect) in all page and resource links. From an SEO perspective this URL prefix is non-optimal therefore the use of a mod-rewrite filter to remove these characters is recommended.
- Personalization elements can only be pre-rendered if the personalization rule is configured for anonymous access.
- The page navigation component cannot be used in a pre-rendered site.
WebSphere Portal deployment patterns
There are two main deployment patterns available for WebSphere Portal server when using WCM pre-rendering:
- Centralised authoring and pre-rendering of WCM content from the same WebSphere Portal server
- Distributed authoring of WCM content and syndication to a single WebSphere Portal server for pre-rendering
Centralised authoring and pre-rendering
This pattern for pre-rendering of WCM content is the simplest deployment pattern and should be used for low-volume sites that have infrequent content updates. Content authoring and pre-rendering occur on the same server at different times of the day.
- Less infrastructure provisioning
- Lower software licensing costs
- No syndication overhead
- Simplification of server management
- Limited fail-over capabilities
- Higher load (although not necessarily concurrent) on the Portal server due to single-site authoring and pre-rendering
- Limited demarcation from work-in-progress content to published content
- Potential for “locking” of libraries during the pre-rendering process
Distributed authoring and syndication to a single pre-rendering server
This pattern for pre-rendering of WCM content requires more planning for WebSphere Portal deployments. It should be used in scenarios where there is a higher volume of content, and a large WCM user-base performing frequent content updates against multiple disparate libraries. Content creators work on different authoring servers on different libraries where-after syndication transfers content to the pre-rendering server.
- Distribution of authoring and therefore server processing load
- Clear demarcation of work-in-progress draft content from published content
- Greater resilience against peak server loads during business hours
- Higher costs due to extended infrastructure provisioning and software licensing
- Overhead of managing and monitoring syndicator/subscriber server-pairs
- Managing the process of synchronized library publishing to a web site
It is strongly recommended that if multiple WebSphere Portal servers are to be provisioned in a pre-rendering deployment topology that they reside within the same LDAP domain. Failure to do this will result in the need to run the WCM member-fixer as a post-syndication activity in order to re-map Portal user IDs bound to the WebSphere Member Manager.
WebSphere Portal configuration for WCM pre-rendering
WCM pre-rendering must be enabled by editing
WCMConfigService.properties located in
Ensure that the following lines exist:
connect.moduleconfig.cacher.cacherclass=com.aptrix.cacher.Cacher connect.businesslogic.module.cacher.class=com.aptrix.cacher.CacherModule connect.businesslogic.module.cacher.remoteaccess=true connect.businesslogic.module.cacher.autoload=true
If the value for
connect.businesslogic.module.cacher.remoteaccess is false it will not be possible for a user to run a manual pre-render unless they are logged into the server and have launched a browser on the host of WebSphere Portal Server WCM instance. If security is a concern then minimize the likelihood that a user will invoke a manual pre-render remotely by setting this value to false.
In the table below, substitute appropriate values where required. For example, the values for directories; start times; and sites should be specific to your installation and functional requirements. Due to table formatting limitations, some of the properties and values contain additional spaces.
||Disables processes that are not required for a subscriber only server.|
||Base directory under which each site cache will be created. There will be one subdirectory created for each site.|
||The temporary directory that is required to build the site cache prior to moving the data over to the base directory specified by the
||This is used to set the time, in seconds, between requesting a page while caching.|
||This 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 is used.|
||Enter an absolute time as shown. These would align with when “business hours” start for the geographic location of the server.|
||Enter an absolute time as shown. These would align with when “business hours” end for the geographic location of the server.|
||The pre-renderer will overwrite files in the destdir cache directory (then delete unneeded files). This results in a progressive change in site content as seen by the user.|
||This determines the user to be used to render the Web Content Management content. Either type Anonymous or Administrator or a specific Member Manager 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.
||The full URL to the CacherModule, which performs the pre-rendering.|
||The path to the Web Content Management servlet not including the context path.|
||This sets the name of the default or home file of the site used when accessing the pre-rendered site.|
||The sites within a Web Content Management environment to cache are entered here, separated by commas.|
||Not applicable.||This value should be commented out.|
||Not applicable.||This value should be commented out.|
||This value should be commented out.|
||Ensure that the business logic setting includes the cacher module in the comma separated list of values.|
After making configuration changes for pre-rendering, restart the WebSphere Portal server.
If the value for
connect.moduleconfig.cacher.overwritecache is true then pre-rendered content will bypass the
connect.moduleconfig.cacher.tempdir and be written directly to the
It is recommended that the server which hosts the WebSphere Portal WCM instance is separate from the web servers responsible for content delivery. At the conclusion of a successful pre-render, files should be copied from the directory specified in
connect.moduleconfig.cacher.destdir to the web server. On that basis the suggested approach is to specify a value of false for the property
connect.moduleconfig.cacher.overwritecache and perform a verification step to ensure valid content was pre-rendered and is ready for transfer to the web server.
The sequence diagram illustrating manual invocation of a library/site pre-render for content delivered through a public-facing web site has the following steps:
- An administrator logs into the Portal Server
- The administrator manually invokes a pre-render for a specific library/site combination
- The WebSphere Portal Server starts the pre-render process (site cacher) writing pre-rendered output to the temporary directory
- Once the pre-render process has completed the pre-rendered content is copied to the destination directory
- The administrator copies the pre-rendered content in the destination directory to a directory used by the HTTP server
- HTTP server delivers content to users
Manually pre-rendering a library/site
Pre-rendering can be manually invoked for a library by using a browser to launch the WCM CacherModule. When pre-rendering a site, the library name and site name must be specified with a URL structure similar to the following:
Manually pre-rendering a content item
Pre-rendering can be manually invoked for a content item by using a browser to launch the WCM CacherModule. If the content item is default content for a site area, pre-render the site area itself. For example:
If the content item is not default content for a site area then specify it using the value in content item name field. For example:
Manually pre-rendering a content item will result in it being directly written to the location specified for
connect.moduleconfig.cacher.destdir irrespective of whether the value for
Security context for pre-rendering
It is recommended that the pre-rendering process is run using the lowest security privileges required, the Anonymous user. This user does not require an account however it is essential that anonymous portal user permissions are granted to every facet of the library and site that are to be pre-rendered. Amongst other things, this includes the library, site, site areas, content items, workflows, workflow stages, library components, menus, navigators, authoring templates and presentation templates.
A simple test to determine whether or not a content item will pre-render correctly using an anonymous context is to browse to the content item on the pre-rendering server and confirm that it renders as expected when previewed using the fully-qualified URL to the content. In other words, you should be able to view the item from a browser that does not have a valid portal session without having to authenticate at the WCM login page.
Content transfer to HTTP servers
Before transferring content to a web server ensure that pre-rendering of a library/site combination has completed successfully using either of the following approaches:
Search the Portal SystemOut.log file for the most recent occurrence of a message relating to the library/site combination that was pre-rendered. The following message [sic] indicates that the pre-render has completed for the library shared and the site resources:
[25/07/10 11:53:54:375 EST] 00000088 AbstractCache I IWKPL1017X: Finished extracing site: shared\resources
Alternatively, confirm that the contents of the directory specified in
connect.moduleconfig.cacher.destdir exist for the library/site combination that was pre-rendered. For example, the directory
connect.moduleconfig.cacher.destdir/shared/resources should contain the static content for the library shared and the site resources.
On the web server create a directory that maps appropriately to the structure specified in the URLs for pre-rendered content. There should be no broken links or missing styles when browsing content.
WCM pre-render performance tuning
- Ensure that the value of deployment.subscriberOnly is set to true. This disables the item gatherer module used by a syndicating server.
- Set the value for
connect.moduleconfig.cacher.delayto 0 (seconds) so that there is no delay between caching pages outside business hours.
- Set the value for
connect.moduleconfig.cacher.busydelayto 1 (seconds) so that there is a balance between the subscriber task process and cacher module during business hours.
- Schedule automated pre-rendering to execute outside the hours specified for
- Ensure there are no errors relating to
EJPSG0002E: Requested Member does not existin SystemOut.log during the pre-render process. If these are being encountered, run the member fixer on the authoring WebSphere Portal Server to remap user IDs.
Frequently asked questions
Q – What happens if a pre-render is running and someone attempts to manually start it for the same library/site combination?
A – The command is ignored and will not be queued. From the log files a message similar to the following will be displayed:
IWKPL1040X: Cacher is currently active for the site [shared/resources]
Q – Why are changes that I made to a content item not showing up on the pre-rendered page?
A – It may be related to a caching issue. Run the pre-rendering again using the additional parameter SRV=flushPageCache. For example:
Q – Does the use of pre-rendering change the content authoring process?
A – No. Pre-rendering imposes no change to the content authoring process.
Q – Why is my site not pre-rendered to disk?
A – It may be related to a configuration issue in any of the variables listed in
WCMConfigService.properties. Validate there are no errors in the log files and that directory permissions have been configured appropriately for the account which runs the WebSphere Portal Server process.
Q – Is there a pub/sub mechanism where clients can register to receive notification that pre-rendering has finished?
A – No. Pre-rendering is run as an asynchronous background process on the WebSphere Portal Server.
Q – Can I alternate the times for which specific libraries/sites are pre-rendered automatically?
A – No. All libraries and sites specified for
connect.moduleconfig.cacher.task.sites are pre-rendered when the cacher module runs at a specified time.
Q – Do all libraries specified for
connect.moduleconfig.cacher.task.sites pre-render concurrently?
A – It depends. Queuing may occur depending on the number of threads running concurrently in the cacher module and the number of libraries/sites that have been specified for pre-rendering.
Q – How long does pre-rendering of a library/site combination take?
A – It depends entirely on how many content items are in the library, how much processing capacity is available on the server, and how much tuning has been performed on the WebSphere Portal server.
WCM Pre-rendering is used to create static HTML content from WCM libraries served through highly performant and scalable web server farms that do not require the dynamic content delivery capabilities of the WCM “Connect” Servlet.
Pre-rendering can be used on WCM libraries of varying size and can be scheduled to run automatically at specific times or be manually invoked by a user.
With pre-rendering it is possible to create a separation of concerns between a WebSphere Portal instance and the content delivery web servers used by an organisation. If dynamic functionality is required at a later date, pre-rendering can be disabled and the WebSphere Portal server can be configured to deliver content via the WCM “Connect” servlet without requiring any changes to the underlying content authoring process or usage patterns.