Enable gzip compression for all versions and keep only the compressed files
Follow-up from Marshall's comment here: gitlab#384875 (comment 1260050259)
Compressed assets like HTML, CSS, and JS, would help us reduce the site size up to 70%. Currently, we only compress the latest docs before we deploy to Pages.
We should instead:
-
Enable gzip compression to all versions, meaning we need the same command we use for the latest docs to also be present in single.Dockerfile
. -
Keep only the compressed assets. All modern web browsers support gzip compression:
Advantages
- Faster frontend performance
- Using less storage probably cuts infra costs
Caveats
The caveats mainly concern our archives:
- We use the same Docker images for the archives versions that we provide for customers who self-host docs. Would it be problematic for self-hosters if we started shipping gzip files instead of HTML? We'd at least need to document that your web server would need gzip enabled.
- For this to solve our current Pages issue, we'd need to create new images for all versions going back to 13.0 (or at least as far back as it takes to get the build size under the threshold that interferes with Pages deploys)
Edited by Achilleas Pipinellis