Skip to main content

Iframe Load Batching

HAPI Elements now queues widget iframe loading and processes them in batches instead of loading all iframes simultaneously. Previously, mounting many widgets at once could create a CPU bottleneck as every iframe competed for resources in parallel. With load batching enabled, iframes are placed in a queue and only a limited number are allowed to load concurrently, reducing resource contention and improving overall page responsiveness.


The maximum number of iframes that can load concurrently is controlled by maxConcurrentLoads, which defaults to 6. Although internal testing showed that a concurrency limit of 2 yields optimal performance, there are technical limitations that need to be resolved before we can lower the default. The batch size can be configured via hapiPreLoadConfig.maxConcurrentLoads.