Minification Definition & Meaning

Minification is the process of minimizing code and markup in web pages and script files without changing its functionality. It strips a code file of all data that isn’t required in order for the file to be executed. Unlike other compression techniques, minified files don’t need to be decompressed before being read, modified, or executed. Minification is used to reduce load times and bandwidth usage on websites. It greatly improves site speed and accessibility, meaning user experience is also improved.

For example, a JavaScript code without minification looks like this:

var array = [];
for (var i = 0; i 

The minified version is equivalent to the original code but is much shorter:

for(var a=[i=0];i

How minification works

Minification is done after the code for a web application is written but before the application is deployed. It works by analyzing and rewriting the text-based parts of a website to reduce its overall file size. After minification, the web server replaces the original assets with minified assets for faster distribution to users.

A web developer will create a JavaScript or CSS file to be used in a web application. These files are formatted for the developer’s convenience. The developer then applies a minification technique to convert the file into one that’s more optimized but harder to read. Minification techniques that are common include:

Once minified, the web server uses the file when responding to web requests.

Minification disadvantages

In some cases, minification can break complicated scripts because of site-dependent variables such as themes, plugins, and server environments. This may result in incorrect layouts or certain functions working incorrectly on a website. Minification can also introduce errors that are difficult to debug. While it can greatly reduce bandwidth usage and provide an increase in site speed, it should be used as a fine-tuning step, not the beginning step in improving a website.






Abby Dykes
Abby Dykes
Abby Dykes is a newly-graduated writer and editor for websites such as TechnologyAdvice.com, Webopedia.com, and Project-Management.com. When she’s not writing about technology, she enjoys giving too many treats to her dog and coaching part-time at her local gym.

Top Articles

Huge List Of Texting and Online Chat Abbreviations

From A3 to ZZZ we list 1,559 text message and online chat abbreviations to help you translate and understand today's texting lingo. Includes Top...

How To Create A Desktop Shortcut To A Website

This Webopedia guide will show you how to create a desktop shortcut to a website using Firefox, Chrome or Internet Explorer (IE). Creating a desktop...

The History Of Windows Operating Systems

Microsoft Windows is a family of operating systems. We look at the history of Microsoft's Windows operating systems (Windows OS) from 1985 to present...

Hotmail [Outlook] Email Accounts

  By Vangie Beal Hotmail is one of the first public webmail services that can be accessed from any web browser. Prior to Hotmail and its...

Legacy Code Definition &...

Legacy code refers to source code that has been inherited from a previous...

Unregulated Power Supply Definition...

An unregulated power supply is a system that transforms input voltage into direct...

Cybersecurity Awareness Training Definition...

Cybersecurity awareness training informs employees of the attack surfaces and vectors in their...