Amazon-web-services – Does AWS Application load balancer actually support compression

amazon ec2amazon-elbamazon-web-services

My front-end code talks directly to the Application load balancer for my backend (using JSON over HTTPS).

I'm starting to retrieve more than trivial amount of data – so I thought I should work out what changes I had to make to support compressing the HTTP data.

I've come across a few posts stating that AWS load balancer compression is broken.

Example: https://medium.com/@sanjay.rajak/why-i-replaced-aws-elastic-load-balancer-to-haproxy-load-balancer-72207fad2d96

But as far as I can tell from the AWS documentation – ELB / ALB etc. don't actually support compression at all.

As a work-around, I can direct my backend calls through Cloudfront or API-gateway to get compression if I want – that's probably even the "right" way to do it, given that these services can also do some caching of requests, etc.

But before I go messing about with these other services – is it true that AWS load balancers don't support compression at all?

Best Answer

I just tested this with an application running behind an Application Load Balancer. With gzip compression enabled on the server, the browser receives gzipped resources. The ALB correctly passes along the content-encoding: gzip HTTP header. Note that with ALB you also get HTTP/2 support which further reduces the time it takes for browsers to load your website's files.

I think that article you linked is incorrect, or out of date, or maybe it's an issue specific to Classic ELBs.

Related Topic