There are few codes which are used to add readability but such codes are not required while executing such applications. White space characters, new line characters, comments, and sometimes block delimiters are examples of a few such characters. During the early development and debugging stage these characters facilitate working with the code in order to improve the readability of coding. Such codes have no place once the application is in the execution stage. It will turn out to be extraneous, and become quite insignificant while executing the application. On the other hand, such elements result in increasing the size of code. Therefore, it is considered good practice to remove such characters before the deployment of application.
Here are few benefits of minifcation process.
- Users load content faster as less unnecessary data needs to be downloaded. Users experience identical service without additional overhead.
- Enterprises see lower bandwidth costs as less data is transmitted over the network. The extra content that only developers care about is no longer being sent to users.
- Enterprises also see lower resource usage since less data needs to be processed for each request. The minified content — which only needs to be generated once — can be used for an unlimited number of requests.
Commonly used tools for JS minification are online JS minifier like YUI Compressor, Closure Compiler or JSMin and for CSS tools such as online CSS minifier like YUI Compressor or cssmin.js can be used.
Minifying websites can lead to large performance gains without compromising users’ experience. Hence, minification will have an influence in improving the ranking of a website as well.