Keep only sourcemaps in .gz

After the removal of NodeJS as a production dependency in omnibus, it enabled a lot of different changes in the frontend compilation process. One of the changes added sourcemaps, which @mikegreiling noted weighted significantly in the omnibus package size.

I've made a few suggestions in the omnibus issue: omnibus-gitlab#1874 (closed)

Gabriel: @mikegreiling I have a suggestion on how to reduce the impact of the sourcemaps size... we could gzip them an provide it compressed to the browsers using the gzip_static on : https://www.nginx.com/resources/admin-guide/compression-and-decompression/. What do you think?

Mike Greiling : @brodock is the *.deb file (or *.yum etc) output by omnibus a compressed file format? Would we gain space by pre-compressing the files within it? If the package formats are not compressed, we could gain quite a bit by: removing the redundant *.gz copies of each asset that sprockets generates. tar + gzip the entire directory bundle the package decompress the directory on installation create optimized *.gz versions of each file post-installation for nginx to serve I guess it depends on whether we are aiming to prioritize reduced download size vs reduced burden on installation machine.

Gabriel: @mikegreiling correct me if I'm wrong, but I see sourcemaps as a "nice-to-have" which can help anyone trying to debug an issue, but it's not a "runtime requirement". Also sourcemaps is only useful if user is in a modern browser. We can't remove the "non compressed assets" for compatibility reasons, but we can remove the non compresses sourcemaps assets, and deliver only the *.gz files. For the other questions: We need both. The .gz are probably already delivered the way I mentioned above I'm not sure if we are going to win anything compressing other assets files again (as packages are supposed to compress stuff already) It's better to generate the .gz during package build time then when we are installing the packages or reconfiguring, as this is when our users complains that our upgrades requires too much of downtime for them. TL;DR If we only pack .gz sourcemaps, we could win in packagesize without impacting in anything else.

cc @mikegreiling

Assignee Loading
Time tracking Loading