Back ForwardHow to capture and deploy static content to an edge server

zzzIn ordinary Web pages, the term static content usually refers to image files (JPG, PNG, GIF, SWF), style sheet files (CSS), and JavaScript files (JS) that change only infrequently.

When your Process Commander application is in production use, these elements of your application's user interface are similarly considered static, even though they may differ from RuleSet version to RuleSet version. For example, a JavaScript routine — saved in a text file rule — is the same for all users who share one access group Alpha (and so have the same RuleSet list). However, users who share a different access group —Beta — may execute a different version of the JavaScript function, from a different version text file rule.

To improve response in a large production system, you can capture a set of the static content files used by a specific access group "hash" value. Three steps are required.

Step 1: Identify and Capture

1. Identify an access group that is used by a large community of production operators. (Choose a widely used access group for which no associated operators have the Allow rule check-out? option selected on the Security tab. Each operator who can check out rules has a unique access group hash value.)

2. Update your system's prconfig.xml file temporarily to add these elements:

<env name="Initialization/nodetype" value="staticcontentcapture" />

<env name="http/remotewebserveraccessgroupname" value="accessgroup" />

where accessgroup is the name of the access group.

3. Stop and restart (or redeploy, if necessary) the system to make these changes effective.

4. Operate the system with normal demand for an entire workday or longer. The system automatically makes a spare copy of each item of static content (from binary file rules and text file rules) in a subdirectory of the ServiceExport directory named RemoteWebServerFiles. (Typically, image files are in a subdirectory named images. JavaScript and CSS files are in a subdirectory named webwb. These names are based on the first key part of the corresponding rules.)

5. Update the prconfig.xml file again to remove the two element added in 2. above, ending the automatic capture.

Step 2: Deploy

1. Identify the host name, TCP/IP port and URL path of an edge server.

2. Copy the entire contents of the RemoteWebServerFiles directory to a directory on an edge server.

3. Using a Web browser, validate that the files just copied can be served, by entering an appropriate URL address. For example:

http://hostname:pppp/path/images/myimage.gif

where hostname is the name or IP address of the edge server, pppp is a port number, and path is the directory in which you placed the folders.

Step 3: Configure

1. Create a RuleSet and Version, separate from existing application RuleSets, to hold an activity rule executed at sign-on by members of the access group.

2. Copy the (empty) standard extension point activity Code-Security.ApplicationProfileSetup to the new RuleSet version, retaining the name to override the original.

3. On the Pages & Classes tab, identify the thread page (named pxThread, class Code-Pega-Thread) and requestor page (named pxRequestor, class Code-Pega-Requestor).

4. On the Parameters tab, identify a string parameter named RemoteWebServerURL.

5. On the Steps tab, first set the local parameter RemoteWebServerURL to the correct URL prefix tested above. (if supporting two or more access groups,

6. Use a Property-Set method to set three property values on the pxThread page to the local parameter value: .pyStaticServerJS, pyStaticServerCSS and pyStaticServerGIF.

7. Use a Property-Set method to set three similar property values on the pxRequestor page to the local parameter value: .pyStaticServerJS, pyStaticServerJS and pyStaticServerGIF.

8. Save the activity form.

9. Add the RuleSet version containing the ApplicationProfileSetup activity to the access group. (Do not add this RuleSet version to the access group of developers or others; they will experience HTTP failures.)

10. Test. Using a HTTP sniffer program such as Fiddler 2 (from WWWwww.fiddler2.com), verify that the images and other static content are correctly served from the edge server.

Notes

At runtime, for users associated with the access group, stream processing automatically inserts the edge server URL as a prefix to the SRC= value in an <IMG ..> tag, <SCRIPT ...> tag or <STYLE ..> tag.

AdvancedIn unusual situations, you can override JSP tags that references to static bundles in your application rules to indicate that the JavaScript or CSS files they reference are to be served from a location other than the pyStaticServerJS and pyStaticServerJS values on the pxThread and pxRequestor pages. Add the attribute prefixURL=" and the initial portion of the URL to the static JSP tag:

<pega:static prefixURL="http:/server:8090/HongKong/" app="webwb" type="script">
<!-- one or more pega:bundle JSP tags -->

</pega:static>

Definitions static content, stream processing
Related topics static JavaServer Pages tag

UpSystem Administration category