What is Minification?

Minification of source code is the process of reducing the size of a file such as an HTML file, a cascading style sheet or JavaScript by removing things that browsers do not require to use the file. The term “mini” means “small”. Minification is aimed are making the source code of web files smaller.

White spaces are a classic example of things that can be removed from the source code of a file during minification. Web programmers format their programs by adding blank lines or spaces in the code for easier readability of the code. These white spaces mean nothing to browsers and search engines and are ignored by them. Many developers do not realize that even these white spaces add to the file size and removing these from the source code would considerably reduce the file size. Minification removes these and any such things in a code that are meaningless for browsers and search engines.

Don’t we all hate it when we have to wait for a web page to load? This impatience is even more so while accessing the web on mobiles or other hand-held devices. Even search engines have now recognized the need for fast loading pages. Page load time is a factor search engines give a lot of importance to while deciding where to rank a web page for a keyword. Minification is one way web developers can improve page load time.

Minification vs. compression

Conceptually, minification is similar to compression of a file in that it is aimed at reducing the weight or size of the file. The main difference between minification of source code and compression is that when files are compressed, they need to be decompressed before they can be opened. There is no need for any decompression when the source code is minified because what the elements that are removed from the source code during minification are unnecessary for browsers or search engines while accessing and reading the contents of the file.

What can be minified?

Minification works especially well with interpreted languages like JavaScripts that are transmitted over the internet. Minification can also be used for reducing the file size of HTML files, Cascading Style Sheets, etc.

Tools to Minify Source Code

There are a number of JavaScript code optimizers like JSMin and Packer, that preserve conditional comments while minifying the source code of a JavaScript file.Closure Compiler is a minification tool released by Google. The tool also has the ability to remove dead code, do aggressive naming and function inlining.Other tools commonly used for minifying source code include Microsoft Ajax Minifier, Yahoo! YUI Compressor and Pretty Diff that have the ability to minify the source code of CSS files.minifyPS is a PowerShell script that can reduce the size of PowerShell scripts and JavaScript files.

Five Benefits of minifying source code

There are many benefits of minifying source code.

Minification reduces file transfers

The main purpose of minification is to reduce the size of the files that are minified. Depending on the original size of the file being minified, it can reduce the file size to a minimal to significant level. The extent to which the file size can be reduced also depends on how much scope for minification exists in the source code.

Faster page load time

Larger files take longer to travel over the internet than smaller files. Since minification reduces the size of the file sizes, it results in faster page load times. It also means that lesser bandwidth is used during the transfer of a minified file — both at the server and the client end.

Better user experience

Faster page load time means better user experience because no one likes to wait for pages to load while browsing. This can only have a positive impact on the impression your website creates on its visitors.

Better organic search performance

With search engines preferring fast loading websites and promoting websites that visitors tend to like, the combination of faster page load time and better user experience will help your website perform well in search results.

Less server space needed

Especially for extremely large websites, minification can mean that you need lesser server space and bandwidth.

There are many reasons to minify source code, and really no reason not to. In a competitive world, every edge that you can give your website adds up. A good and professional web design company would make sure that you get the maximum from your website.

Professional Web Design Services from Flying Cow Design

Flying Cow Design has a track record of over 20 years of professional web design. What differentiates us from most web design companies is that our focus is not only on web design, but on building a strong online presence for our clients. Understanding the changing web development standards and search engine guidelines has helped us build a strong web presence for many of our clients through a combination of our web design and internet marketing services. To see how we can help you build a strong web presence, write to us today!

CEO, Flying Cow DesignAttended University of AucklandLives in San Francisco Bay Area

October 18th, 2016

What Our Customers Say

Flying Cow Design first designed our website back in 2006 and since then we have used them for incremental updates and various design changes. During this 4 year period I have found FCD to be responsive, professional and attentive to our needs.

Flying Cow helped take our site from concept to reality, offering suggestions at each step of the way, many of which proved to be enhancements to the basic layout and functionality we originally drafted.

"WOW how do I pick this apart... I just love it. You have left me speechless. I am so happy."

Citizens Climate Lobby was completely impressed and satisfied by Flying Cow Design's ability to dive in and solve urgent problems. They were easy to work with, incredibly responsive, competent and professional.

Flying Cow has provided Cyber VAULT Services with excellent support in the design and the implementation of our website. Additionally, the ongoing support from Flying Cow has proven to be very reliable and timely. They have been a real asset to my company.

When it comes to online business, price is not the only consideration. You need someone that you can trust, that will give you sound, honest advice, that will look after your site, its program, its data, as if it was his own. To us, Flying Cow Design is more a partner than a service provider.

Web Site

Need help with Web Design?

Write to us with your project details and we will get back to you shortly.