Does Cornerstone / Content Builder need jQuery, cs-head.js/cs-body.js on the front-end when the admin is not logged-in?

Hi,

I’m trying to optimize my custom theme (not the X), and I noticed that Cornerstone is automatically adding:

  • jquery.js
  • jquery-migrate.min.js
  • cs-head.js
  • cs-body.js (in the footer)
    Totalling the 281 KB.

Are those files needed for an appropriate showing of the content on the front-end to the non-logged-in visitor of the site?

I’m assuming that some Cornerstone components need jQuery and CS JS files for the interaction and the animations. If that is so is there any list of components that do need those JS files and what for?

For basic laying out the “grid” and basic elements like titles, text, images, … JS is probably not needed, right?

Looking forward to hearing from you.

Cheers

Hello @dasbios,

Thanks for writing in!

Yes, those files are necessary to run Cornerstone smoothly. Even if the page is having Cornerstone basic element but to run those element properly necessary programming has been done in the JS files.

As you are optimizing the load time, I would suggest you to take a look at our performance optimization guide to improve load time:

Thanks.

Thank you for your quick reply.

Thank you for the performance optimization link.

I’m planning to use the Cornerstone just for positioning of the basic elements (grid, headline, text, …) and would not like to have a 281 KB of overhead.

Can you please provide the list of components that do (not) need JS for working (grid, headline, text, …)?

Can I dequeue jQuery and CS scripts? Is there any parameter/hook for that?

Cheers.

Hi @dasbios,

We do not recommend dequeuing any scripts related to Cornerstone as this will affect the functionality of the other features that come in the package and it might cause more issues.

But what you can try to do is to disable the element that you do not use using the Permission Manager:

Hope this helps.

OK. I see.

Will that decrease the size of CS assets (CSS, JS) that are loaded?

Cheers.

Hello @dasbios,

Thanks for writing in!

It might not reduce the file size of individual JS and CSS files but over page load time will have improved especially in the backend. Please try out the solution shared by Jade and then run a speed test to see how it goes.

Thanks.

I’ll try it out.

Thank you for the information and your support.

Best.

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.