The source project of this merge request has been removed.
Support for statically compressed gzip content-encoding
All threads resolved!
All threads resolved!
Compare changes
Do not update/delete: Banner broadcast message test data
Do not update/delete: Notification broadcast message test data
Related to #12 (closed), this MR enables serving precompressed gzip content in GitLab Pages.
To use it, static files that are to be served compressed must be present at the same location as the uncompressed file, with the extension .gz
. The uncompressed file must remain present so that:
gzip
can still receive the content,.tar.gz
file which should not have the Content-Encoding
header attached to the response. (Otherwise the browser may decompress and present a .tar
file to the user.)The gzipped content must be placed in the same directory as the uncompressed content. When the latter is a symlink, the gzipped content must be placed at the symlink target directory with the same file basename as the target. For example, if the file index.html
is symlinked to content/frontpage.html
, then the gzipped content must be located at content/frontpage.html.gz
. This is both to co-locate the gzipped content with the uncompressed variant and to simplify the implementation.
Directory index.html
files and the /404.html
files can also be compressed by having corresponding index.html.gz
and /404.html.gz
compressed variants.
HTTP HEAD
requests continue to work correctly; the Content-Encoding
header is also applied as appropriate, so that HTTP clients can know that they may receive compressed content in that case.
I am keen to see this merged and deployed to GitLab Pages so that my (and everyone's) static sites load much faster: HTML, CSS, and JavaScript as you know often compresses with very high ratios. I'm sure GitLab Inc. would enjoy the bandwidth (cost) savings too.