logo

Brotli / Gzip Test Bench

Static resources

Each resource is fetched and its transfer metrics are read from the Resource Timing API. encoded is the size on the wire, decoded the size after decompression.

URLStatusContent-EncodingContent-TypeEncodedDecodedRatio

Dynamic responses


    

Compressed request bodies

Browsers can only produce gzip / deflate via CompressionStream. Use curl for br request bodies (see the commands below).


    

Endpoints

# Response: brotli
curl -s -o /dev/null -D - -H 'Accept-Encoding: br' http://localhost:8085/data/lorem.txt

# Response: gzip
curl -s -o /dev/null -D - -H 'Accept-Encoding: gzip' http://localhost:8085/data/lorem.txt

# Request: brotli body (requires the brotli CLI)
echo '{"hello":"brotli"}' | brotli -c | curl -s --data-binary @- \
  -H 'Content-Type: application/json' -H 'Content-Encoding: br' http://localhost:8085/inspect.json

# Request: gzip body
echo '{"hello":"gzip"}' | gzip -c | curl -s --data-binary @- \
  -H 'Content-Type: application/json' -H 'Content-Encoding: gzip' http://localhost:8085/inspect.json