Contributions 1 min read

# Added async option to headscript fix

Check out one of our Pimcore developers helped add the async option to the headscript, and bringing closer the release of Pimcore X!

Last updated on 29 August, 2025

## Key takeaways

1. Before this contribution, Pimcore's headScript templating helper could not load frontend scripts asynchronously on a page.
2. The contribution added a headScript option that renders the async attribute on the script tag when it is requested.
3. Loading large, non-critical scripts asynchronously avoids increasing initial page load time while HTML is parsed and more important scripts run.

## **What was the issue?**

The issue was that loading frontend scripts using headScript templating helper asynchronously wasn’t possible.

## **How did you solve it?**

I’ve solved it by adding an additional option for headScript which when rendering script tag will add async attribute if it’s passed when requesting for a script.

## **Why is this fix important?**

It is good to have this option in case we have larger scripts and the time of their execution is not important. This way, we won’t increase initial page load time during HTML parsing and execution of other more important scripts.

## **How does it feel to contribute to a platform such as Pimcore?**

It feels good to contribute to Pimcore knowing that your change might help someone and in the end help Pimcore become a better and more reliable platform.

And if you want to check out this [pull request](https://github.com/pimcore/pimcore/pull/8139), just follow the link!

## Related

[Contributions **Object brick – Allowed classes sorting and filtering** Another day - another pull request! Our Pimcore developer, Dino, has made sure that Pimcore object bricks gain a new upgrade. Check it out! 1 min read](https://factory.dev/pimcore-knowledge-base/contributions/object-brick-sorting-filtering) [Contributions **Fix to update object\_url\_slug to correct character set and collate** Check out our latest contribution the the Pimcore platform! Step by step, together we're building the ideal platform for the entire Pimcore community! 1 min read](https://factory.dev/pimcore-knowledge-base/contributions/object-url-slug-fix) [Contributions **Query builder – missing condition variables** Check out one of our pull request that's now officially a part of Pimcore's code! 1 min read](https://factory.dev/pimcore-knowledge-base/contributions/query-builder-missing-condition-variables)

---

Source: https://factory.dev/pimcore-knowledge-base/contributions/added-async-option-headscript-fix
