Menu

Our CDN compresses every page with brotli quality 3, and plain gzip wins on 20 of our 79 pages
📰

Our CDN compresses every page with brotli quality 3, and plain gzip wins on 20 of our 79 pages

DEV Community: nextjs·Daniel Pertu·1 day ago
#GcI3JxrH
#devtonextjs#devto#dev#encoding#gzip
Reading 0:00
15s threshold

Every page of our site is prerendered and served from a CDN edge, so compression is somebody else's job and I had never checked what they were doing with it. Here is how to find out from the outside, and what the answer was.

Ask the same URL four times with four different Accept-Encoding values and record the transfer size:

for ae in br gzip zstd identity ; do printf '%-9s %s\n' "$ae" \ "$(curl -s -o /dev/null -w '%{size_download}' \ -H " Accept-Encoding: $ae " https://pub-trivia.app/faq)" done

Enter fullscreen mode

Exit fullscreen mode

br 12318 gzip 12194 zstd 78658 identity 78658

Enter fullscreen mode

Exit fullscreen mode

Two things in four lines. Gzip beat brotli on this page.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.