views:

59

answers:

1

Hi,

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.

A: 

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.

David
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
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
OK. I'll try that. And how do I evaluate if the actual response was compressed? Evaluate Content-Encoding?
er4z0r
Correct. This site had good info about this: http://www.http-compression.com/
David