Pergunta

Eu tinha algumas perguntas a respeito comprimir cabeçalhos de solicitação HTTP aqui e aqui mas eu de alguma forma pulado a parte de resposta HTTP ... Eu estou procurando uma maneira de reduzir / compactar os cabeçalhos na minha resposta HTTP ...
A situação é que eu estou comunicando um aplicativo Java ME com um servidor remoto e qualquer bagagem extra é fazendo-me derramou um monte de $$ ...
Presumindo que o cliente eo servidor estão sob meu controle que solução seria você sugere?

Foi útil?

Solução

The same general mechanisms for compressing requests apply to responses. And once again, the headers themselves are not compressible ... only the response content can be compressed in an HTTP 1.1 compliant implementation.

The way to specify that the server should compress the response is to set an "Accept-encoding" header, as described in section 14.3 of the HTTP 1.1 spec. However, you are at the mercy of the service implementation as to whether it will actually compress the response for you. If the server cannot / will not compress as you have asked, it may send a 406 Not Acceptable response. Alternatively, a crufty server-side HTTP implementation may ignore your Accept-* headers and send the response uncompressed.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top