-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable brotli compression on hxldash.com #85
Comments
This is great research. Thank you. I will update the server this Friday and will enable this! |
I tried implementing this today, but ran into trouble that the module is not recognised with apache. i tried upgrading apache on a test server and still then it is not recognised. a2enmod brotli I tried implementing the AddOutputFilterByType, but that was not recognised either, so I will investigate more. Test server is hosted here: http://34.229.180.70/ |
Can you return the output of the commands? With the exact OS version I may try a quick install on some VPS just to check this.
|
@SimonbJohnson @Rydela This comment is a reference for #66 (comment) and this #66 (comment). I will post here on the #85 since is somewhat a way to debug who implement. maybe this is a result of testing the
Way to test compression: curl strategyRefs: https://stackoverflow.com/a/18984239/894546 One way to test the content is with compression is using TL:DR: # fititnt at fititnt-bravo in ~ [20:22:27]
$ curl --compressed --head https://hxldash.com/static/geoms/topojson/BRA/2/geom.json
HTTP/1.1 200 OK
Date: Fri, 26 Jun 2020 23:23:06 GMT
Server: Apache/2.4.29 (Ubuntu)
Last-Modified: Fri, 26 Jun 2020 10:36:32 GMT
ETag: "2d498e-5a8fa48559a72"
Accept-Ranges: bytes
Content-Length: 2967950
Content-Type: application/json
# fititnt at fititnt-bravo in ~ [20:23:07]
$ curl --compressed --head https://hxldash.com/static/libs/hxlbites/hxl.js
HTTP/1.1 200 OK
Date: Fri, 26 Jun 2020 23:23:26 GMT
Server: Apache/2.4.29 (Ubuntu)
Last-Modified: Wed, 20 Feb 2019 12:02:09 GMT
ETag: "cb4a-582522099e320-gzip"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 11484
Content-Type: application/javascript
# fititnt at fititnt-bravo in ~ [20:23:30]
$ curl --compressed --head https://hxldash.com/view/341
HTTP/1.1 200 OK
Date: Fri, 26 Jun 2020 23:23:44 GMT
Server: Apache/2.4.29 (Ubuntu)
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
# fititnt at fititnt-bravo in ~ [20:23:46]
$ curl --version
curl 7.69.1 (x86_64-conda_cos6-linux-gnu) libcurl/7.69.1 OpenSSL/1.1.1g zlib/1.2.11 libssh2/1.9.0
Release-Date: 2020-03-11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTPS-proxy IPv6 Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets
Brotly or GZipFrom https://daniel.haxx.se/blog/tag/brotli/ (NOVEMBER 29, 2017, curl v7.57.0) says:
Since depending of the version of the curl as soon as brotli is enabled, the result may be the most efficient, the more specific question from https://stackoverflow.com/a/18984239/894546 instead of use ## GZip only
curl -sH 'Accept-encoding: gzip' --head https://hxldash.com/static/geoms/topojson/BRA/2/geom.json
curl -sH 'Accept-encoding: gzip' --head https://hxldash.com/static/libs/hxlbites/hxl.js
curl -sH 'Accept-encoding: gzip' --head https://hxldash.com/view/341
## Request similar to a browser like Chrome
curl -sH 'Accept-encoding: gzip, deflate, br' --head https://hxldash.com/static/geoms/topojson/BRA/2/geom.json
curl -sH 'Accept-encoding: gzip, deflate, br' --head https://hxldash.com/static/libs/hxlbites/hxl.js
curl -sH 'Accept-encoding: gzip, deflate, br' --head https://hxldash.com/view/341 Way to test compression: Using Chromium based browsersHere explain one way https://webmasters.stackexchange.com/a/105061/42038. Requires "Large request rows" option enabled. This may be good to comprare compressed vs umcompressed. Here a quick print screen, sorted by request size |
refs
Since the response headers of hxldash.com give a hint that the server version is
Server: Apache/2.4.29 (Ubuntu)
and Apache Module mod_brotli have compatibility ofAvailable in version 2.4.26 and later
seems to be a good idea enable brotli compression.From https://www.brotli.pro/enable-brotli/apache/, the minimum steps would be:
a2enmod brotli
as rootAddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/javascript
on the Apache VirtualHost of hxldash.comOne thing we could do is take at least the home page of hxldash.com and one or two dashboards (maybe the common case, and maybe one with lots of data that could be compressed, like the geojsons) and inspect the before/after on the pagesize.
Since is possible to force fake request headers, this could be done after brotli already was enabled.
PS.: I can confirm that the https://proxy.hxlstandard.org/data/source does not have brotli enabled (but the response header says
server: nginx
, so as commented here #66 (comment) it may be less simple to suggest implementation there)The text was updated successfully, but these errors were encountered: