Preventing Script Optimization

By default StoreFronts will take the external scripts on the page or included and unify them into a few .js files that are injected into the page near the close body tag. The reason for this is:

  • Reduce the number of requests

  • Delay the execution of scripts to increase the load time of pages

  • Push the JS files to the CDN for faster delivery to the customer’s browser.

By default inline script tags on the page will be pushed down to the end of the page. If for some reason you have a script tag that you do not want moved you can add an attribute to the tag of “data-uc-ignore” and UltraCart will leave that script alone.

<script type="text/javascript" data-uc-ignore="true"> // Your script here. </script>