Skip to content

Add gzip compression to CI deploy phase

Justin Ho Tuan Duong requested to merge justin_ho-add-gzip-step-to-ci into master

Description

According to gitlab-pages!25 (merged), GitLab Pages can serve files that are gzipped statically as long as they have the same name with the extra .gz extension. The gzipped files will be served as Content-Encoding: gzip.

This MR adds static gzip of some assets that can benefit from the compression:

  • HTML
  • JS
  • CSS
  • SVG

Note: While testing on the review app, I wasn't able to test the compression of JS / CSS / SVG files. I asked on our internal Slack here: https://gitlab.slack.com/archives/CSLU7BMPF/p1587022757200500. TLDR of it is that "it works on production".

Before and after results

Size of the HTML document size on some pages (does not include any other assets aka not the full page size):

Page Before After
/ee/README.html 281.16KB 71.74KB
/omnibus/README.html 158.39KB 45.50KB
/runner 155.08KB 47.23KB
/ee/user/project/ 258.40KB 67.55KB

Overall, this gives us 75-80% easily.

Related issues and links

Inspired by #455 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports