Closed mdonadoni closed 1 year ago
Regarding the comments made in the related issue
check which format to use (depending on popularity, browser support, server side support, performance, ...)
I have chosen gzip as it is supported out-of-the-box by the nginx
docker image, while also being the most popular format used on the web (see here). Brotli would need an additional extension which is not included in the official nginx
docker image.
decide whether it's worth it to enable compression
When opening the homepage of REANA (with cache disabled), the transferred size goes from 1,64MB to 620kB (-62%). When opening a ROOT file, the additional JS file needed goes from 1,78MB to 510kB (-71%).
start serving compressed static files (JS sources, but also CSS), either:
compressed on-the-fly at runtime (see NGINX docs about compression)
generating already compressed sources at build-time and serving them (see
gzip_static
directive of NGINX as an example)
Given that nginx only serves static files, it makes more sense to pre-compress them instead of compressing them on-the-fly at each request. For this reason, the gzipped-version of JS/CSS files are generated at build time.
Rebased and merged!
Compress JS/CSS files with gzip after
yarn build
and configure nginx to serve the pre-compressed files.Closes #328