Improve application loading time with preflight optimization
Most of the static content for an application—the JavaScript files and Cascading Style Sheet (CSS) files—loads when the user starts the application. By using preflight optimization to reduce unnecessary static content, you can speed up your application’s initial display time, which can be especially important for applications that users access occasionally or just once.
Application load time improvements are most noticeable for mobile applications that are running in areas of reduced network speed but also apply for desktop applications.
Only necessary files are optimized
Preflight optimization analyzes an application's rule model and creates optimized JavaScript and CSS files that are purpose-specific for the UI components that are actually used by the application.
General process
You run optimizations by access group and portal before you release your application.
After you run the process, review the optimization report to identify the UI components, rules, and CSS formats that were included in the optimization process.
To further reduce your application's static content, you can remove more files and repeat the preflight optimization process. Use the report to identify which files are needed for a component to work and which files you can remove without affecting the application.
JSP <static> tags with "moveToEnd" attributes
If your application uses JavaServer Pages (JSP) <static> tags and you include a <static> tag with the attribute "moveToEnd,"the code is not included in the optimization process.
For example, you might have the following in your application if you were to copy existing Pega code:
<pega:static type="script" app="webwb" moveToEnd="true">
<pega:bundle name=”databundle”/>
</pega:static>
With optimization turned off, this bundle of JavaScript files is included at the bottom of the HTML document. With optimization turned on, this bundle is not included at all.
Rerunning the optimization process
When you change the portal, the application's content, or the application’s skin, repeat the preflight optimization to remove any unnecessary static content that was introduced by your changes.
Previous topic Checking results and JavaScript file dependencies Next topic Improving your compliance score