> For the complete documentation index, see [llms.txt](https://shoppad.gitbook.io/infinite-options/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shoppad.gitbook.io/infinite-options/troubleshooting/performance-and-optimization/can-infinite-options-scripts-be-deferred-or-loaded-asynchronously.md).

# Can Infinite Options scripts be deferred or loaded asynchronously?

### **Why Infinite Options scripts load on every page**

If you've reviewed your store's Google Speed test PageSpeed Insights or Lighthouse report, you may notice that Infinite Options scripts appear on pages where you haven't added any option fields, like your homepage or collection pages.  \
\
This is expected behavior, and it's not specific to Infinite Options.

### **How Shopify loads app scripts**

Shopify uses a system called ScriptTag to inject app scripts into your storefront. When an app is installed, Shopify controls where those scripts are loaded, and that's sitewide by default.\
\
Apps don't have the ability to limit script injection to specific page templates, like product pages only. This is a Shopify platform constraint that applies to every app in the Shopify ecosystem.

### **Can the scripts be deferred or lazy-loaded on non-product pages?**

No. Shopify requires app scripts to load fresh on each page request, which means standard browser caching and deferral techniques don't apply.&#x20;

### **What PageSpeed and Lighthouse are actually measuring**

Tools like Google PageSpeed Insights and Lighthouse measure your store against an idealized environment with no apps, fonts, analytics, or theme features present. Any app script will be flagged as a performance issue in these reports, even when everything is working normally. The warnings don't necessarily reflect what your shoppers experience in real-world conditions.

Even large, well-optimized Shopify stores score lower on these tools for the same reason. A lower Lighthouse score caused by app scripts is expected and doesn't mean something is broken.

### **What you can do**

If store speed is a priority, Shopify has guidance on improving overall performance here: <https://help.shopify.com/en/manual/online-store/store-speed/improving-speed>

For questions specific to how Infinite Options loads on your store, contact our support team.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://shoppad.gitbook.io/infinite-options/troubleshooting/performance-and-optimization/can-infinite-options-scripts-be-deferred-or-loaded-asynchronously.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
