What is Minification?


minification-1024x446 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!

fb50c5bf790872a8ecad33a6bd15d358?s=100&d=mm&r=g What is Minification?

CEO, Flying Cow Design
Attended University of Auckland
Lives in San Francisco Bay Area

October 18th, 2016


Need help with Web Design?

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


Related Articles
Self-hosted WordPress sites are versatile platforms for building a business. The secret to WordPress' flexibility
If you are a business owner looking to grow your business online, here are three
A payment gateway facilitates online credit card payment processing on your website. The software and
An iframe or inline frame is essentially a browser window set within the web page.
Content marketing creates organic traffic, but it requires sound strategy. Separating the two is like
When we look back over the last 10 years, it is amazing how corporate websites
When one mentions browsers, most instinctively think of Internet Explorer, Mozilla Firefox and Google Chrome.
Not often are CSS and typography used in the same sentence and in many ways,
It's rare to find a website to be completely free of errors. This is usually
What are web fonts? When designing for offline media like brochures, billboards, press advertisements, etc.,