Reduce cornerstone javascript (cs-classic.js & x.js)

Thought it was worth asking if anything can be done to look at putting some of this JavaScript on a diet as it can hurt mobile pagespeed which is most important for ranking. or a toggle to switch for sites that aren’t using any cornerstone legacy features.

I can see just scanning some of these javascript files cs-classic.js & x.js are sharing some code. Quite a bit according to page for a site I tested (might be different for people using legacy components) is not being used or for legacy browsers.

Anyway some stats below from pagespeed that might be useful

Thanks!


image

Forced reflow
A forced reflow occurs when JavaScript queries geometric properties (such as offsetWidth) after styles have been invalidated by a change to the DOM state. This can result in poor performance. Learn more about forced reflows and possible mitigations.

Source Total reflow time
/cs-classic.7.7.4.js?ver=7.7.4 27 ms

and maybe this

Reduce unused JavaScript

URL Transfer Size Est Savings
/cs-classic.7.7.4.js?ver=7.7.4) 34.9 KiB 21.2 KiB