I see lots of information about enabling http compression for server responses but what about for incoming requests. Wouldn't it make sense for the browsers to compress large form posts before sending them to the server?
Another example is a REST web service that we use. We have to send frequent PUT requests with large XML files (10+ MB) and would definitely see some bandwidth/speed benefits on both sides.
So is this a solved problem on the server side or does each web application have to handle it individually?
Best Answer
To
PUT
data to the server compressed you must compress the request body and set theContent-Encoding: gzip
header. The header itself must be uncompressed. It's documented in mod_deflate:And an article describing it is here:
Separately, a browser can request server response content to be compressed by setting
Accept-Encoding
header as per here:This will return compressed data to the browser.