Tuesday, March 17, 2015

ADF JavaScript Partitioning for better performance


What is JS Partitioning?
By default ADF framework downloads a bunch of Java Script libraries on each page load and we should consider to bucket the JS library calls to reduce the number of calls made. By default all ADF pages need the boot.js and core.js files to operate.

Additionally, JS files are downloaded either combined as partitions or one for each component (if no partition is defined).

Why should we implement it?
ADF is smart enough to download only the javaScripts belonging to the components rendered on the page. If individual JS files are downloaded, however, then there will be lot of network traffic per page, slowing down the page performance. The solution is to use JavaScript Partitions.

How to implement it?
The exact procedure is to create the java script partitions xml file with the name adf-js-partitions.xml file in WEB-INF and configure the partitions as needed. More documentation can be found here