stellar-deprecated / horizon

This repository has moved to the go monorepo: https://github.com/stellar/go/tree/master/services/horizon
Apache License 2.0
218 stars 106 forks source link

Enable HTTP compression (gzip / brotli) on the horizon stellar.org servers #431

Open chatch opened 6 years ago

chatch commented 6 years ago

As far as I can tell http text compression is not enabled.

This would speed up responses quite a bit.

curl -v -H "Accept-Encoding: br, gzip, deflate" https://horizon.stellar.org
* Rebuilt URL to: https://horizon.stellar.org/
*   Trying 54.165.37.174...
* Connected to horizon.stellar.org (54.165.37.174) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certificates.crt
* found 597 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: *.stellar.org (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: OU=Domain Control Validated,OU=PositiveSSL Wildcard,CN=*.stellar.org
*    start date: Mon, 17 Jul 2017 00:00:00 GMT
*    expire date: Thu, 16 Aug 2018 23:59:59 GMT
*    issuer: C=GB,ST=Greater Manchester,L=Salford,O=COMODO CA Limited,CN=COMODO RSA Domain Validation Secure Server CA
*    compression: NULL
* ALPN, server did not agree to a protocol
> GET / HTTP/1.1
> Host: horizon.stellar.org
> User-Agent: curl/7.47.0
> Accept: */*
> Accept-Encoding: br, gzip, deflate
> 
< HTTP/1.1 200 OK
< Content-Disposition: inline
< Content-Type: application/hal+json; charset=utf-8
< Date: Sun, 25 Feb 2018 06:23:52 GMT
< Vary: Origin
< X-Ratelimit-Limit: 17200
< X-Ratelimit-Remaining: 17199
< X-Ratelimit-Reset: 3599
< Content-Length: 1484
< Connection: keep-alive

My use case is for steexp.com. I'm doing some performance optimisations and realised everything was coming back uncompressed.