How to Enable Compression on Shopify – Google PageSpeed Insights Fix

2018-12-07T21:01:11+00:00April 3rd, 2018|Performance Optimization|0 Comments

This article references the “enable compression” warning in PageSpeed Insights. If you’re looking for Image Compression, click here for the details on how to compress your images in Shopify.

There are 2 ways to make your files smaller: minifying and compressing them.

Minifying scripts and stylesheets removes all the excess spacing and code comments in the actual files to max compact the code and file size.

Compressing files makes them lighter to transfer from your server.

What is compression?

Compression is a technique that allows the web server and browser to agree on a common compression format (gzip) and transfer much lighter files.

Google says gzip compression can reduce the size of the transferred response by up to 90%. Whoa!

How to enable compression

It’s handled on the server, but you don’t need to know the technical details.

If you’re on a Shopify site, your files are likely already compressed.

If you have Shopify and are getting this warning from PageSpeed Insights, it’s likely a file from a 3rd party app.

In this case, you can email the app support and ask if they can compress their files.

Here’s a quick template you can copy/paste:

Hi,

I checked my Google PageSpeed Insights and it looks like there’s an uncompressed file being served from your app.

Any chance you can compress that?

Thanks

How to find which app is serving the uncompressed file(s)

If you came here after checking your Google PageSpeed Insights, You’re probably seeing something like this:

page speed insights example of uncompressed files

Go to your PageSpeed results and hover over the filename and it will show the full path.

If you don’t recognize the file name, you can try these methods to figure out which app is serving it up:

  1. Try going to the root domain. In the 2 examples above the domains are smile.io and loggly.com.
  2. If that doesn’t work, try copying the file path and searching “what is [paste file path here]“.

In that screenshot, I recognize the domain “smile.io” as a match with an app of the same name. So I can just go to the app in Shopify and contact them from there.

The second file I don’t recognize, but I can go to loggly.com and see that it’s an app.

Success rate

It’s considered best practices to compress resources, but sometimes an app developer may have a reason for not compressing. If the file is under 10kb, it’s probably not worth the effort.

On the other hand, if you’re dealing with something like this:

You can save significant page weight and load speed by getting the files compressed. *This is a screenshot from GTmetrix, referring to a slider plugin (sliders can be heavy).

More Speed Tips

Here are 3 DIY tips to make your Shopify site faster.

You can also check out more Performance Optimization posts here.

If you’re tired of reading and want a Shopify optimization specialist to take a look at your site, contact us here.

About the Author:

Joe's a Shopify Expert, eCommerce entrepreneur, and the founding architect of Speed Boostr. Outside of tech he's into travel, trees, books, and music 🤙

Leave A Comment