White spaces are one such thing that can be eliminated from the code of a site to make it smaller. Some web programmers add blank lines and spaces in their code to make it easy to read. These white spaces are meaningless to search engines and web browsers. Hence, these lines get ignored by the search engines. These white lines and blank spaces increase the file size and removing them from the source code of a site can make the file size much smaller.
How is it different from compression?
At the concept level, minification may be similar to compression of a file. Both these things aim to reduce the size of the file. However, these two are not the same thing. The main difference is that compressed files need to be decompressed first before opening them. However, when a source code is minified, there may be no need to decompress the files.
What are the things that can be minified?
· Closure Compiler which is a tool released by Google. This tool can remove dead code, do aggressive naming and function inlining.
· Microsoft Ajax Minifier, Yahoo! YUI Compressor and Pretty Diff that help to minify the source code of CSS files
Reduces file transfers
The main purpose of file transfers is to reduce the size of files. The size of the files can be reduced significantly depending on the size of the original file.
Reduces page load time
Since big files take a lot of time to load, minification can help to reduce the page load time considerably. As a result, the bandwidth used to transfer files will also be reduced.
Improves user experience
Nobody likes to wait long for a page to load. Reducing the page load leads to better user experience.
Improved organic search performance
Search engines prefer websites that load fast and promote sites that are liked by users. Since minification helps you to reduce your page load time and improve user experience, your site will be liked by search engines as well.
Less server space required
If your website is large, minifying the code will mean that you need lesser server space to host your site.