Ask your host to compress pages, stylesheets and scripts on the way to the browser. It is a server setting many older accounts never switched on, a free test shows whether yours did, and phones benefit most.

Text that travels at full size

Every page a visitor opens is mostly text: the page itself, the stylesheets that set its look, and the scripts that make menus, sliders and forms work.

A server can compress those files before sending them, and the browser unpacks them as they arrive. Every current browser asks for compressed files, and has done for years.

It is one of the oldest and simplest speed settings on the web. On many older hosting accounts it was never switched on, or only for some of the files.

Nothing looks wrong when it is off. Pages simply arrive larger than they need to be, every time.

What compression covers

The third usually matters most. A WordPress site with a theme and a dozen plugins can send more script than page, and scripts shrink very well.

Photographs are not on the list. JPEG and PNG files are already compressed, and squeezing them again achieves nothing; large ones need resizing instead, which is a separate job.

Why text shrinks so much

Web files repeat themselves constantly: the same tags, the same style rules, the same names, hundreds of times over.

Compression replaces each repeat with a short reference to the first one. The browser reverses it in a moment, and the visitor never sees any of it.

Text files often end up a fraction of their original size. The page is identical; only the trip is shorter.

Why phones feel it most

On an office connection, the difference may hardly show. On a phone with two bars of signal, or a rural connection at the end of a long line, every file is a wait.

Phones also start each visit to a new site with nothing stored, so the first page downloads everything: every stylesheet and every script.

And mobile data costs money. A visitor on a small plan pays for every unnecessary byte, whether or not they ever think about it.

How it gets left off

Usually through age or accident rather than a decision.

Some server software compresses only the pages themselves unless it is told which other file types to include. Settings written years ago list the types that existed then, and can miss the label a newer setup uses for scripts.

Moving a site to a new server can drop the setting without anyone noticing. So can removing a caching plugin that had quietly been handling it.

Checking it with a free test

PageSpeed Insights, Google's page testing tool, lists any files sent without compression under a heading about enabling it, along with how much each could shrink.

WebPageTest, another free tool, gives the site a grade for compression and names the files that let it down.

Test more than the home page. A product page, a blog post and the contact page often load different scripts.

Anyone comfortable with the browser's developer tools can also look at a single file's response headers, where compressed files are marked as gzip.

A worked example

A small heirloom seed company sells several hundred varieties of vegetable, herb and flower seed through its website, and January is when its customers sit down with the catalogue.

Many of them garden on rural properties and browse on phones with patchy signal, or on slow rural internet in the evenings.

Each variety has its own page of growing notes. The site runs on WordPress with an online store, and every page loads a long list of stylesheets and scripts from the theme and plugins.

A PageSpeed Insights report showed the pages themselves arriving compressed. Every stylesheet and script was going out at full size.

The cause was the server's configuration. Compression had been switched on years earlier for pages only, and the list of file types had never been extended.

The host added the missing types in a few minutes. The same test now finds nothing left to compress, and each catalogue page sends far less text to a phone at the end of a farm road.

Asking the host

The request is short: please enable gzip compression for HTML, CSS, JavaScript, JSON, XML, SVG and any font files that are not already compressed.

On most hosting this takes minutes. Some control panels have a switch for it, and on others it is a few lines in the server's settings or in the site's own configuration file.

Then run the test again to confirm. If a host cannot or will not switch on something this basic, that says something about the rest of the hosting.

What compression does not fix

Files loaded from other companies' servers, such as web fonts, maps or chat widgets, are compressed or not by those servers. Your host cannot change them.

Compression also does nothing for oversized photographs, or for a page that simply loads too many files. Those are separate jobs, and often bigger ones.

But it is the cheapest of the three to fix, which is why it belongs first.

The counter-case

Many hosts now switch compression on by default, so plenty of sites are already fine and need only the test to prove it.

A small site of a few plain pages gains little, because there is little to compress. And a heavy site with oversized images will still be slow afterwards.

None of that is a reason to skip the check. It takes a minute, and if compression is off, the fix is a short request to the host.

The check

  1. Run a page through PageSpeed Insights.
  2. Look for files flagged as uncompressed.
  3. Test a product page and a blog post too.
  4. Ask the host to compress every text file type.
  5. Run the test again to confirm it worked.
  6. Repeat the check after any server move.
  7. Note images that need resizing separately.

Step four is the whole fix, and usually the shortest job on any speed list. One request to the host changes every page on the site at once.

The other server-side question worth raising with the host at the same time is covered in which kind of security certificate a small business needs.


Frequently asked questions

What does server compression do?

The server squeezes text files such as pages, stylesheets and scripts before sending them, and the browser unpacks them instantly. Less data travels, so pages arrive sooner, especially on phones.

How do I know if it is switched on?

Run a page through PageSpeed Insights or WebPageTest. Both flag files sent without compression, and the list shows whether pages, stylesheets or scripts are missing it.

Does it shrink images too?

No. JPEG and PNG files are already compressed, so compressing them again gains nothing. Oversized photographs need resizing before upload, which is a separate job.

Why would compression be switched off?

Older hosting accounts often predate it as a default, some server software compresses only pages unless told otherwise, and the setting can be lost when a site moves servers.

Will compression slow the server down?

Hardly. Compressing text takes very little processor time, and for a small business site the saving in transfer far outweighs it. Many servers keep compressed copies ready anyway.

What should I ask the host?

To enable compression for pages, stylesheets, scripts and other text files, then to confirm it with a test. On most hosting it is a few minutes of work.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Not sure your server compresses anything?

Tell us your web address. We will test it and tell you exactly what to ask your host.

Start a Conversation