Skip to main content
Apply for a Cheap Website
Website explainer · 1:47

What Is Minification? Smaller Website Code Explained

Why does production website code look squashed together? It trims the code while keeping its intended behaviour.

Jersey Web video: Less code to download

1:47 · No narration: the video shows each step as text on screen, and every step is written out below, with buttons that jump the video to it.

Download the on-screen text track (VTT)

The six points in the video

This is a silent video. The headings, explanations and labels below reproduce the information on screen.

  1. Step 1: Start with the source file

    Developers write readable code with spacing and useful comments.

    On-screen labels: Readable source; Useful formatting; Editable project.

  2. Step 2: Remove unnecessary characters

    A minifier can strip whitespace and other non-essential text.

    On-screen labels: Less whitespace; Removed comments; Smaller output.

  3. Step 3: Preserve the behaviour

    The built file should still perform its intended task.

    On-screen labels: Same intended result; Valid output; Working interaction.

  4. Step 4: Compression is another step

    Minification and transfer compression can work together.

    On-screen labels: Smaller source text; Compressed transfer; Separate techniques.

  5. Step 5: Keep the original source

    Future maintenance should use the editable project files.

    On-screen labels: Original project; Version history; Rebuild process.

  6. Step 6: Test the production build

    Check the actual optimised files used by visitors.

    On-screen labels: Important pages; Browser errors; Essential interactions.

A practical check for your business

Retain readable development sources and review the delivered production files separately. Check the resulting page after optimisation so a smaller script or stylesheet does not conceal a broken feature.

Sources and further detail

Common questions

Why does production website code look squashed together?

It trims the code while keeping its intended behaviour. Keep the editable source and test the built result.

Go further

Guide Read the practical guide More context for planning and maintaining your business website. 5 min read → Jargon Buster Minification explained Read the related Jargon Buster explanation. Read the explanation →

Keep the editable source and test the built result.

Tell Jersey Web what your website needs to do and which part you want help with.

Talk to Jersey Web →

More video tips

All 205 videos →
Length 1:47 Design and images

Image Aspect Ratios and Cropping: Keep the Important Subject Visible

Match the image to the space.
Length 1:47 Website performance

Bits and Bytes Explained: MB, Mb and Download Speeds

File sizes and transfer rates.
Length 1:47 Website performance

What Is a Viewport? The Browser Space Your Website Can Use

Viewport, explained.