static content

Static content refers to information that can be extracted once from a rule to a HTTP server or Web server and thereafter is unaffected by use of an application, the contents of user clipboards, and so on.

PRPC stores static contents for these rule types:

Each directory below the StaticContent directory contains extracted static content; the directory name encodes the exact RuleSet list that the content belongs to. To minimize storage, PRPC creates directory names with a hash code derived from an entire RuleSet list.

As a result the file system may contain many different files named CompanyLogo.jpg. Which CompanyLogo.jpg file that a user receives for display in a browser session depends on that user's RuleSet list.

Static content bundling

Through static content bundle rules (Rule-File-Bundle) and the static JSP tag, PRPC can serve multiple JavaScript or CSS files, defined by text files rules, in a single HTTP response. Such bundling can improve response times by delivering all files needed by a form to the workstation browser at once, rather than through a one-by-one sequence of HTTP requests.

Using a bundle rule is usually preferred over one large text file containing all the JavaScript or CSS code, though both approaches consolidate the related parts into one HTTP response. When you use the bundle rule, the component text file rules that are bundled remain distinct and shorter, simplifying maintenance and allowing rule resolution to operate.

Static Content purging

The StaticContent directory can grow to contain thousands of subdirectories and files, especially in a development system where each developer has distinct RuleSet lists and Rule-File- rules are changing.

Periodically, the Pega-RULES agent runs an activity that purges static content directories, deleting files and subdirectories that are older than a specified period. By default, this activity runs once each hour and deletes files and subdirectories more than 30 days old. You can change this retention period through the by updating the PegaRULES agent schedule.

Deleting old files and subdirectories saves disk space and also simplifies the directory structure, improving runtime access. If a user at runtime later needs a file that was purged, a new copy is re-extracted from the database, on demand.

Notes

The pr_file_store database table provides an index to the files and directories within /Common/StaticContent/*.*.

The RuleFileServlet servlet locates and "serves" the correct version of a static content file to a user. If the static, extracted file has never previously been referenced, this servlet extracts it first from the rule.

PRPC supports HTTP compression of static files, to reduce HTTP message size and network demand. Static file compression is controlled by the following Dynamic System Settings:

Dynamic System Setting: prconfig/HTTP/ServerGZIPenabled/default

The prconfig/HTTP/ServerGZIPenabled/default setting (for UNIX servers) is enabled by default, meaning that compression occurs. If needed for debugging or other purposes, you can disable compression.

The following values are valid for this Dynamic System Setting:

Value

Description

true Static file compression is enabled. (Default)
false Static file compression is disabled.

Dynamic System Setting: prconfig/HTTP/ServerZIPenabled/default

The prconfig/HTTP/ServerZIPenabled/default setting functions identically to the prconfig/HTTP/ServerGZIPenabled/default setting, only for Windows servers.

The following values are valid for this Dynamic System Setting:

Value

Description

true Static file compression is enabled.
false Static file compression is disabled. (Default)

Caution: Change this setting with care. Prconfig Dynamic System Settings can have broad impact on the operation of your system.

Use the System Management application to delete all static content extracted on the current node.

To clear the Internet Explorer cache on a workstation, select the Tools > Internet Options > General > Temporary Internet Files menu item, click  Delete Files   and click  OK  . (Other browsers offer a similar menu option.)

By default, the HTTP messages sent from PRPC to a browser session have a cache-control setting of 24 hours (86,400 seconds). The following Dynamic System Setting controls this HTTP setting:

Dynamic System Setting: prconfig/HTTP/DefaultCachingTimeout/default

The prconfig/HTTP/DefaultCachingTimeout/default setting controls how long static content, such as the login image, is considered current by the browser. If content is not current, then the browser will request updated data from the server.

The following describes the valid values for this Dynamic System Setting:

Value Description

Integer. Time, in seconds, that the browser will consider the cached static content current. The default value is 86,400 seconds. (24 hours)

Caution: Change this setting with care. Prconfig Dynamic System Settings can have broad impact on the operation of your system.

The location of the StaticContent directory is determined by the temporary files path in the prconfig/Initialization/explicitTempDir/default Dynamic System Setting.

Dynamic System Setting: prconfig/Initialization/explicitTempDir/default

The prconfig/Initialization/explicitTempDir/default setting specifies the full path to be used as the work directory. This allows you to use a shorter path to the temp (work) directory, in order to avoid exceeding various platform path name limits. If this Dynamic System Setting is not defined, the path supplied by the application server is used.

The value specified by this setting is ignored unless the directory already exists. Make sure you create the directory specified prior to starting PRPC. If the directory does not exist, then the temp directory provided by the application server will be used, and no warning or error will be logged.

You can use Java property substitutions to specify this setting as a JVM system variable (example: ${setting} ). In WebSphere, the WAS policy file as initially installed expects a Java property named pega.tmpdir to point to the explicit temp directory location. Using this property name in conjunction with the substitution (example: ${pega.tmpdir} ) will keep the reference consistent.

The following describes the valid values for this Dynamic System Setting:

Value Description

Full path of the work directory. Example: C:\pegarules\temp.

Caution: Change this setting with care. Prconfig Dynamic System Settings can have broad impact on the operation of your system.

In a production system, user response may be improved by deploying "edge" servers.

Related Topics IconRelated terms