Hi there,
Defering of JavaScript isn’t done by default, because while it is good for page speed tools like gtmetrix, in reality it can easily break features, because you cannot control the order in which the files are loaded.
In order to defer JavaScript files, you can add the ones you want to defer (the original names) in the setting “Load JavaScript asynchronously”.
Marc.
Awesome. Thanks. I missed the fact that no JavaScript was deferred by default. Can you suggest the best way for me to compile a list of JavaScript files that might be considered for deferral?
Seth
Hi Seth, Sorry for the delay in responding.
The files that can be deferred will vary a lot from website to website. Sometimes you could defer everything, but it can also break things.
To identify the individual files loaded on your site, you can go to WP-Optimize > Minify > Advanced > List of processed files. Pressing “Show information” will show the list of processed files.
You can then use these URLs in the “Load JavaScript asynchronously” option.
You could put everything in there, or add them one by one, and test what works bit by bit.
Marc.
Thank you! That is helpful. I found the lists. What controls whether or not an entry appears on the list? The first time I loaded the page there were about a dozen each JS and CSS files. The next time I loaded the page, there were no files listed. Then I reloaded again in a little while and there were about 5 files listed for each.