Speed up page loads in Chrome on custom pages that reference external scripts by adding
the defer attribute to your script tags. Custom pages include
those in managed packages, such as Apex pages, Visualforce pages, and Lightning container
components.
Where: This change applies to Lightning Experience and Salesforce Classic in Enterprise, Performance, Unlimited, and Developer editions.
Why: Salesforce renders Content Security Policy (CSP) as a meta tag. In
Chrome, this causes external scripts to download one at a time, which slows page loads. The
defer attribute restores parallel download and preserves execution order.
How: To restore parallel downloads on custom pages, add
defer="true" to each script tag. For example:
<script src="https://example.com/library.js" defer="true"></script>
async attribute also triggers parallel downloads, but it doesn't
presever execution order. Use defer for most pages. Scripts with
defer run after the page is parsed, so inline scripts depend on them must wait
until they load.