shou2017.com
JP

How to Compress Resources Using Gzip or Deflate for a Hugo Site

Fri Oct 6, 2017
Fri Oct 6, 2017

When I checked the site created with Hugo using PageSpeed Tools, the results were quite poor, so I decided to fix at least the gzip and deflate parts.

Initially, it looked like this:

Compress resources using gzip or deflate

Oh! That’s bad.

This method cannot be used unless you are using CloudFront. So, if you want to compress resources using gzip or deflate, make sure to set up CloudFront first.

If you are already using CloudFront, the process is super simple.

Compress resources using gzip or deflate

Just change the last line, “Compress Objects Automatically,” to “Yes.”

By making this change, the results improved significantly.

Compress resources using gzip or deflate

Reference: AWS Official Blog

See Also