I use this to check whether a server compresses its responses at all.
curl -s --compressed -D - -o /dev/null https://example.com/ | grep -i '^content-encoding'
--compressed sends an Accept-Encoding header with the encodings your curl supports and decompresses the answer, so you read plain text. -D - prints the response headers to standard output and -o /dev/null drops the body. A content-encoding: gzip line means the server compressed it. Which encodings are offered depends on the build: gzip needs zlib, and brotli and zstd are only present in some builds. Run curl -V to see the list. Without --compressed a server that compresses anyway would hand you unreadable bytes when you add Accept-Encoding by hand.
Further reading: curl manual