Site optimization with Cornerstone help

I’ve built a lot of sites using cornerstone. And the biggest issue I’ve had is that cornerstone really dislikes it when I minify the java and CSS. I had used shortpixel on one of the sites and everything was working great. It took my google page speed score from 0/100 to 38/100. Google suggested that I minify the code so I used WP Total Cache to do that and suddenly the site broke because of conflict with the way cornerstone writes the CSS and java. What is going on? Cornerstone is supposed to be optimized out of the box. I’m aware that my images were the improper codec and I fixed that with short pixel. But why isn’t the java and css properly optimized?

Hi @motorcityhealth,

Thanks for reaching out.

Minification is never part of the theme and plugin (but it does come with pre-minified scripts so minification isn’t necessary). If you’re using a cache and minification plugin or services, I recommend contacting them for proper optimization.

It’s not a conflict, your optimization just merged all the scripts and css then obscured it, like compressed it. And because of that, it can affect the functionality IF the merged scripts are not in proper order (script dependencies). Please note that Wordpress is a modular type setup where scripts can be coming from Wordpress itself, from the plugins, and from the theme. And each plugin or theme could have a different author (even jQuery libraries has many authors, like you download them from multiple sites) so serving one single minified file isn’t really possible, hence, a 3rd party optimization plugin is there to minify and combine them. And just like other optimization services and plugin, it could improve it or break it depending on how you configure it, and it’s not because the theme, plugins, and Wordpress have issues.

Try turning off caching and minification for logged in users in your W3 Total Cache plugin. Google only analyzes what’s displayed on the front and not in the backend, so you shouldn’t really applying cache and minification in the admin like the builder. Cache is against change, and what you’re applying in the builder are changes.

Thanks! :wink:

Then what can be done to improve that 38/100 score with cornerstone without the use of plugins?

Hi,

You may exclude the following js files in w3 total cache

wp-content/plugins/cornerstone/assets/dist/js/site/cs-body.js
wp-content/plugins/cornerstone/assets/dist/js/site/cs-head.js
wp-content/plugins/cornerstone/assets/dist-app/js/cs-vendor.js
wp-content/plugins/cornerstone/assets/dist-app/js/cs.js

If you are using PRO Theme

wp-content/themes/pro/cornerstone/assets/dist/js/site/cs-body.js
wp-content/themes/pro/cornerstone/assets/dist/js/site/cs-head.js
wp-content/themes/pro/cornerstone/assets/dist/js/site/cs-vendor.js
wp-content/themes/pro/cornerstone/assets/dist/js/site/cs.js

No need to minify these files as they are already minified by default.

Hope this helps

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