Search code examples
pagespeedsquarespace

How to defer parsing common-e20e84229bae737cf39e8-min.en-US.js in SquareSpace?


I am trying to speed up my Squarespace website and I noticed the problem was in Javascript file common-e20e84229bae737cf39e8-min.en-US.js.

enter image description here

How can I defer parsing this js file to speed up my website?


Solution

  • Unfortunately, the only way to control the loading of that script (and many other assets/data) within a Squarespace v7 website is to enable Developer Mode, remove the {squarespace-headers} system variable, and then explicitly include each of the elements from that variable that would normally be automatically included within {squarespace-headers}.

    That system variable is usually located in the site.region file.

    Before removing it, you'll need to view the source of your rendered website in the browser, and take note of all of the data that the {squarespace-headers} system variable is creating. It's a LOT of data, and you're going to have to manually recode ALL of it. It will be quite time consuming to do and maintain. It includes all of the highlighted data in the following image:

    enter image description here

    That is a very tedious process and, if done, will likely result in continuing upkeep of the code you write in its place, as Squarespace may update various paths and data. It may not be stable.

    Therefore, although it is technically possible, it is not recommended. It is also not recommended to enable developer mode unless you have experience working with it and are familiar with the ramifications of enabling it.