More about Static Content Bundle rules
Static content bundle rules define a group of JavaScript files or Cascading Style Sheet (CSS) files, identified as text file rules, that the server transmits to workstation browsers as a single unit or "bundle". Used appropriately, static content bundles can reduce HTTP network traffic and reduce user response times.
When to create a static content bundle rule
Create a static content rule if your application RuleSets contain multiple text file rules that are needed together to render or support a browser window. You can continue to update the text file rules (in the same or higher versions).
For example, if your application includes a JavaScript function ALPHA that calls other functions BETA and GAMMA, you can choose to send all three files to the browser as soon as it requests any one.
Static content can be incorporated in any stream rule, supporting gadgets, and portal rules.
Creating a bundle rule
To bundle multiple text files rules into a single static content response:
- Identify the static files (all of a single type, CSS or JS) to be included
- Create a bundle rule using the Static File Bundle form.
- Create an HTML fragment rule that uses the static JSP tag (and one or more bundle JSP tags) to identify the bundle.
- Update a stream rule to include the HTML fragment, with the <pega:include > JSP tag or by another means.
- Test. Use Fiddler2 or similar HTTP debugging tools to confirm that a browser receives the entire bundle in a single response.
Whenever possible, maximize use of auto-generated HTML code even when adding a static file bundle to a stream rule. For example, you can identify an HTML fragment in a portal rule by name, letting PRPC auto-generate the <pega:include > JSP tag.