Leap provides several advanced settings to help optimize scripts and improve page load times. These settings can be found under Leap > Optimize > Script Execution.
- Script Delay: This feature delays the loading and execution of JavaScript until the primary content has loaded. By prioritizing the loading of content, Script Delay helps improve Largest Contentful Paint (LCP). Do NOT delay scripts marked with no-defer parameters: This setting prevents scripts marked with no-defer parameters such as 'data-cfasync' and 'data-pagespeed-no-defer' from being delayed. This is crucial for preventing unwanted delays that could break functionality or slow down site loading.
- Reduce CPU Intensive Tasks: This feature slows down JavaScript tasks that are using excessive CPU. By reducing the load on the browser's processor, it helps free up resources to render the page more efficiently, thus improving LCP. Note that this setting may affect the timing of `setInterval` and `setTimeout` calls.
- Disable Ads Above The Fold: This feature aims to improve page performance and Core Web Vitals (FID, LCP) by removing ads that appear above the fold (the content visible before scrolling). While this can enhance performance, it may also decrease revenue as above-the-fold ad locations are typically higher earning. Use this setting as a last resort.
- jQuery Loading Method: jQuery is a widely-used JavaScript library, and loading it can take time. Leap offers two methods to optimize jQuery loading:
- Core jQuery Feature Preload: Instead of excluding the entire jQuery library when scripts that require jQuery functions are excluded, this method adds a small script to enable core functionality until the main jQuery file is loaded.
- Load jQuery from CDN: This method loads jQuery from a global Content Delivery Network (CDN) so that more users have it cached, reducing load times.
Learn how to best implement a jQuery loading method here.
Common Issues
Script delay can cause issues with the following functionalities:
- Menus
- Search bars
- Page layout
- Image loading
- Forms and other custom functionality
Learn how to address these issues using our Debugger here.
Conflicting Technologies
Certain technologies can make optimizing your site with script delay challenging:
- Page Builders: Tools like Elementor and WPBakery are completely incompatible with script delay, necessitating its disablement.
- Themes: Some themes, including Kadence and Astra, may require extensive script exclusions for correct site functionality.
- Speed Optimization Tools: Tools such as Perfmatters and WP Rocket can conflict with script delay settings. They don't need to be disabled altogether, rather the setting that is providing duplicate functionality should be identified and turned off.