Control Load Position and Async/Defer Estimated reading: 4 minutes 4 views Contributors Summary: Learn how to control CDN script load position and async/defer behavior in Antimanual Builder Pro. This guide explains when to use head, body-end, async, and defer for reliable, performance-friendly page enhancements. CDN Library Attachments let you connect external CSS and JavaScript libraries to a page, while controlling load position and async/defer behavior. This gives you precise control over how each asset is delivered, helping you balance performance, rendering order, and script execution without copying files into your project. Pro Tip: For better performance, control script load position and use async or defer with guidance from Introducing Docly Documentation WordPress Theme 2.0.0. What Load Position, Async, and Defer Mean When you attach a CDN script, you can decide whether it loads in the document head or at the end of the body. You can also set whether the script runs with async or defer behavior. These options control when the browser downloads the file and when it executes it. Head: useful when a script must be available early in the page lifecycle.End of body: useful when you want to reduce interference with initial page rendering.Async: downloads in parallel and executes as soon as it is ready.Defer: downloads in parallel and executes after HTML parsing is complete. When to Use Each Setting Use the head location when a library must be available before the page finishes loading, such as for critical UI behavior or early initialization. Use the end of body when the script supports visible content and can wait until the page structure is already in place. This is often the safer choice for front-end enhancement scripts. Async works best for independent scripts that do not depend on other files or on the order of execution. Defer is better when script order matters, or when the file needs access to the full DOM after the page is parsed. If you are unsure, defer is usually the most predictable option for page-level libraries. How to Control CDN Script Loading In Antimanual Builder Pro, load behavior is editable directly from the CDN attachments list. This keeps asset management simple and avoids deeper code changes during routine page building. After adding a library, review its loading behavior and select the placement that matches the library’s technical requirements. Add the external CSS or JavaScript library to the page attachment list.Choose where the file should load: head or body end.Set async or defer where appropriate for JavaScript files.Preview the page to confirm the library behaves as expected. For practical guidance on attachment setup, see . If you are planning a larger workflow that includes imported layouts or existing pages, the content structure in Introducing Docly Documentation WordPress Theme 2.0.0 can also help you decide where external assets fit into your build. Recommended Usage Patterns Use load controls to match the purpose of each asset. A lightweight icon set or animation helper may be suitable for the head with defer, while a non-essential enhancement script can often be moved to the end of the body. This approach helps preserve performance while still giving you access to third-party libraries. Use defer for scripts that should wait until markup is ready.Use async for independent third-party utilities.Keep critical initialization scripts as early as they truly need to load.Prefer body-end placement for enhancements that do not affect first paint. Performance and Reliability Considerations Choosing the right load position can improve perceived performance and reduce blocking during page rendering. However, the wrong setting can also cause dependency issues if a script runs before the elements it needs are present. Always test the page after changing load behavior, especially when combining multiple CDN libraries. If a script fails to initialize, check whether it depends on another file, whether it needs the DOM to be ready, and whether async execution is introducing an unwanted timing change. In many cases, switching from async to defer provides a more stable result. Best Practices Start with the least disruptive loading option that still meets the script’s needs.Use defer for order-sensitive front-end libraries.Reserve async for scripts that can run independently.Review the page in the browser after each change.Keep only the libraries you actually need on each page. For related setup steps, you may also want to review Spider Themes Helpdesk to understand how the builder handles page-level controls and The Advantages and Disadvantages of Developing a Custom WordPress Theme to see how external services and imported assets are managed. With load position and async/defer controls, you can integrate external libraries more confidently and maintain a cleaner page build process. The result is a more flexible workflow with better control over performance and script execution. Control Load Position and Async/Defer - PreviousAttach External CSS and JavaScriptNext - Control Load Position and Async/DeferWhere Files Are Stored