Minification
Minification is the process of removing unnecessary characters from source code, like whitespace, comments, and long variable names, without changing functionality, reducing file size for faster loading.
When developers write code, they use whitespace, indentation, descriptive variable names, and comments to make it readable. Browsers don't need any of that. Minification strips these human-friendly elements from CSS, JavaScript, and HTML files, producing smaller files that load and parse faster.
A 500KB JavaScript file might minify to 150KB, a 70% reduction. CSS minification removes comments, whitespace, and redundant declarations. It can also combine shorthand properties, merge identical selectors, and remove unused vendor prefixes.
In practice
- A web application's JavaScript bundle went from 1.2MB to 340KB after minification, and down to 95KB after gzip compression, loading in under 1 second on 3G
- A WordPress site installed a minification plugin and improved their PageSpeed Insights score by 15 points just from CSS and JS minification alone
- A SaaS dashboard's CSS was 280KB unminified, after minification and purging unused styles, it dropped to 18KB, eliminating render-blocking delays
- A developer accidentally deployed unminified code to production, causing page load times to double, their CI/CD pipeline was updated to prevent this from happening again
Not sure how this applies to you?
A senior engineer walks your site, your search presence and the way enquiries reach you, then writes down the three things worth fixing first. You keep the document either way.
