LinkedIn
Copied!

Table of Contents

How to improve response by distributing static content to remote edge servers

Summary

If the server hosting your PRPC application is distant from your users, you can improve performance by deploying static PRPC content to a cache on an “edge server,” a local computer closer to your users.

PRPC stores application- and PRPC-related static content files (for example, image files, style sheets, and JavaScript files) in the database, for example in Binary file rules and Text file rules.

Once your application accesses these rules, the static content is cached on the server disk in the Static Content directory in the PRPC temporary directory. These cached files can be distributed to local servers for improved performance: subsequent calls for these rules are made to the local server instead of the main server hosting PRPC.

This article describes how to

  • Identify and extract static content
  • Deploy the static content data on another server
  • Configure PRPC to use the deployed static content

Prerequisite: Your application must use the static JavaServer Page tag in HTML references. For details on using the static JSP tag, see the Developer Help.

Important:  Consider the frequency of potential changes to static content. This process does not provide for automatic updates to cached content on the edge server; the process must be repeated to capture any changes to static content.

Note: For V5.X systems, See How to improve response by distributing static content to remote edge servers.

Suggested Approach

This process should be applied to each access group using the edge server.

Step 1:  Identify and Extract Static Content

Use the following process for each application rule for which static content will be extracted:

  1. Identify the application rule.
  2. To trigger auto-generation of custom style sheets (CSS files), run all possible flows in the application. This manual process is required in PRPC versions 6.2 and later.
  3. Run the application.
  4. Click the Pega button (Pega button) System > Tools > Extract Edge Server Files.
  5. On the Extract Edge Server files window, select the application and version.
  6. Enter a file name for the extracted content zip file.
    Extract Edge Server Files window
  7. Click Create Zip File. The system displays progress, and when complete, an option to save the zip file locally.

 

Step 2: Deploy Static Content to the Edge Server

  1. Identify the host name, TCP/IP port, and URL path of the target edge server.
  2. Extract the contents of the zip file created in Step 1 to a directory on your edge (HTTP) server.
  3. Verify the extracted files can be read. You can enter a URL address into a web browser followed by the name of an extracted file. For example:

http://hostname:port/path/ReadMe.txt, where:

  • hostname is the name or IP address of the edge server
  • port is the port number of the HTTP (edge) server
  • path is the directory where you placed the static content folders on the server

Example: http://myserver:8080/PRPC_StaticContent/ReadMe.txt:
Extracted ReadMe file

 

Step 3: Configure PRPC to Use Cached Static Content

PRPC provides a placeholder activity, Code-Security.ApplicationProfileSetup, which is called during user login. Modify this activity to direct the remote users’ systems to the edge server for static PRPC content.

The property pyEdgeServerURI identifies auto-generated static content references. This property is used at the Requestor level and must be set to the path of the edge server in the activity.

The remotely cached static files are valid only for users of the application specified in Step 2. Therefore the activity should be restricted to users whose access group references the application rule. Save the activity to a different RuleSet version, then add that RuleSet version to the application definition as a Production RuleSet, so it can be assigned only to the specified Access Group. (For details on Production RuleSets, see  KB #25158, How Process Commander Assembles an Application RuleSet List.)

Modify Code-Security.ApplicationProfileSetup as follows:

  1. Create a new RuleSet and version separate from the existing application RuleSets.
  2. Copy the activity Code-Security.ApplicationProfileSetup to this new RuleSet Version.  Do not change the name or Defined On class of this activity.
  3. Click the Pages & Classes tab.
  4. In the Page Name field, enter pxRequestor.
  5. In the Class field, enter Code-Pega-Requestor.
  6. On the Steps tab, delete the placeholder Java step.
  7. Use a Property-Set method to set property value pyEdgeServerURI on the pxRequestor page to the path of your edge server. Enclose the path value in quotation marks. Example:
    Set the pyEdgeServerURI
  8. Save the activity.
  9. Add the RuleSet containing the modified ApplicationProfileSetup activity to the Application definition as a Production RuleSet.
    Add Edge Server RuleSet
  10. Add the RuleSet containing the modified ApplicationProfileSetup activity to the Access Group.
    Add Edge Server RuleSet to Access Group
  11. Verify that the images and other static content are served from the edge server by testing your setup as described in the next section.

 

Test your setup

NOTE: Before testing your setup, clear the client browser cache. In Internet Explorer, click Tools > Internet Options. On the General tab, under Browsing History, click the Delete button. On the Delete Browsing History window, select the Temporary Internet files checkbox and click Delete.

  1. Clear your client browser cache.
  2. Log in in to Process Commander as a user associated with the appropriate Access Group.
  3. Using an HTTP debugging Web proxy server application such as Fiddler, verify that the static content is being served from the edge server.

 

Suggest Edit

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.