JavaScript and CSS minifications. Better ways.

Updated Dec 6, 2023

What is minification. The best ways to optimize JavaScript and CSS.

Minification is the process of reducing the size of the code without changing its functionality. This allows you to reduce the weight of the page and, accordingly, speed up its loading. This optimization has become an industry standard. Now it is difficult to find a popular site that would not minify its code.

Any code can be minified, be it JS, CSS or HTML. Any code can be minified, be it JS, CSS or HTML.
Any code can be minified, be it JS, CSS or HTML.

How to minify code

You can minify your files manually using the free online service [http://refresh-sf.com /](http://refresh-sf.com / “Free online JavaScript/CSS minifier”). But we recommend setting up the automatic optimization process.

[CSSO] Programs(https://github.com/css/csso-cli “A program for optimizing CSS code”) and UglifyJS has proven itself well and shows some of the best compression results. Many programmers give them their preference. [Comparison of different JavaScript minifiers](https://blog.logrocket.com/uglify-vs-babel-minify-vs-terser-a-mini-battle-royale / “UglifyJS effectiveness study”). [Comparison of various CSS minifiers](https://goalsmashers .github.io/css-minification-benchmark / “Investigation of the effectiveness of CSS minifiers”).

If your site runs on a CMS system such as WordPress, Drupal or any other, then you can find a ready-made plugin that automatically optimizes all files. Here is a good plugin for WordPress [https://wordpress.org/plugins/bwp-minify /](https://wordpress.org/plugins/bwp-minify / “WordPress plugin for optimization.”).

Minification is configured once and benefits all the time. It is especially useful for visitors from mobile devices.

We use cookies. By continuing to use the site, you agree to the processing of personal data in accordance with privacy policy. I agree