Take the 2-minute tour ×

I want to find about the HTTP 1.1 compression of the site I am talking to. I need to do it programmatically in Java.

What I want to find out is: Does the server support compression for incoming requests? Does the server support compression for responses?

Thanks in advance.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

There isn't a general case answer for this. The HTTP/1.1 spec lets the client tell the server that it accepts compressed responses, but from the response you can't tell a difference from a server that can't compress responses and a server that just decided not to compress your single response.

share|improve this answer
Hmm. And I cannot "force" the server to give me compressed data? Like saying "hey, I only accept gzip and nothing else!" and then see if I get compressed data or an error-code. –  er4z0r Nov 3 '09 at 20:27
Client's can send an "accept" header that says they support GZip or deflate compression, but it's always assumed that they support non-compressed data as well. –  David Nov 4 '09 at 16:34
OK. I'll try that. And how do I evaluate if the actual response was compressed? Evaluate Content-Encoding? –  er4z0r Nov 5 '09 at 14:36
Correct. This site had good info about this: http-compression.com –  David Nov 5 '09 at 19:15
add comment

Your Answer


