Rate Your Experience

Script Delay

Modified on: Fri, 29 Oct, 2021

Script Delay delays the loading and execution of Javascript until the primary content has loaded.

Many websites implement scripts that are vital to various features on a page which you may not want to delay and the Script Delay feature offers multiple options to assist you with exclusion rules for scripts you do not want the feature to impact.

Exclusion Rules:


image


Examples:


/file.js will match the script:


<script src="http://yourwebsite.com/js/file.js"></script>


myUniqueVar will match the script:


<script>var myUniqueVar = 'myUniqueString'</script>


Page Rules


image


Page Exclusions allow you to exclude all scripts on specific pages and directories from being delayed.

Examples:

/ will match the the homepage.


/example.html will match http://bermuda-attractions.com/example.html


A wildcard can also be used to match directories. For example, /path/* will match any page in the path directory.

Find Delayed Scripts:


image



The Delayed Scripts tool allows you to quickly populate a list of external and inline scripts found on a specified URL that the Script Delay feature will delay. Once the list is generated, you can easily choose which scripts you wish to include in the URL rules for Script Delay by selecting Yes|No.


1. Scripts marked ‘no’ will automatically be added to the URL rules for the tool and will no longer be delayed.

2. Scripts marked ‘Yes’ will remain delayed by the Script Delay feature unless changed by the user.

You can also exclude certain scripts from being delayed by using the 'no defer' parameters. Here's some info on how to implement them:


https://developers.google.com/speed/pagespeed/service/DeferJavaScript



Loading ...