More about Static Content Bundle rules
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.