How can I effectively minify CSS and JavaScript for website optimization?

Minais
Excursionist
21 2 2

Hey Y'all 

 

So, I am currently trying to optimize both speed and SEO of my website.

 

When I use the PageSpeed insights, it shows me that I have a lot of unused css and js files. I have tried minifying the js files, but the more I minify them, the slower my website gets. (I tested it on a copy of my OG store). 

 

How can I minify the files in the most comprehendable way? And how can I know which codes are in use, and which aren't? That way I can at least erase them. 

Replies 2 (2)

GadgetBM
Shopify Partner
8 1 2

The idea of minifying is not to make the code readable, minify once your code is finished, if you have important updates just "unminify".

 

Preload your css/js.

 

Also a link to your site would be nice - we're not magicians either.

Online Electronics Store
If I've helped you, feel free to give me a thumbs-up!
https://gadgetbm.com/
Minais
Excursionist
21 2 2

I was only asking for a way to figure out how to differentiate between used and unused code in general, and if the minifying can be done in a more comprehensive manner.