PLAT-2390: gzip responses
Added gzip middleware and tests. Now the response is smaller from the tranfer:
3.1 kB transferred
14.0 kB resources <--- Resources now is smaller than tranferred
Also gzip is supported:
$ curl -H "Accept-Encoding: gzip" -I http://localhost:8080/measures?aggregation=measure_uri
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Authorization, x-test-header, Origin, X-Requested-With, Content-Type, Accept
Content-Encoding: gzip <---SEE HERE
Content-Length: 2619
--> With the flag REDIS_COMPRESS to true and min. size reached:
2025-10-15 10:40:54,462 [INFO] cache: Cache SET key=all-measures-with-descriptions, gzipped=True, size=2579
With the min. size over the request:
2025-10-15 10:59:53,766 [INFO] cache: Cache SET key=all-measures-with-descriptions, gzipped=False, size=14052
Edited by Cristian Garcia