0

Sending Accept-Encoding: gzip to my server currently upgrades the server responses with gz compression.

Sending Content-Encoding: gzip POST bodies to my server does not result in my application being activated.

Ignoring all other concerns, what are the steps necessary to upgrade my server to support GZipped POST bodies?

0

ASP.NET is dynamic compression....

Make sure dynamic compression checkbox is checked see: http://ericsowell.com/blog/2013/6/7/enabling-gzip-in-iis-on-windows-8

  • enabling dynamic compression is required but insufficient to upgrade a server to supporting GZipped POST bodies. For reference, dynamic compression has been enabled on my server since initial installation. (If dynamic compression was not already enabled, the server would not have replied with gzipped responses on request. I mentioned that the server is replying with gzipped responses in my original question) – K. Alan Bates Jun 19 '17 at 16:46
  • yep, Compressed Request Post needs a handler in IIS. as well as a way for the browser to compress. the RFC 2616 allows for it, even what t respond if it is not supported. Here is some related stackoverflow.com/questions/4377106/… – Phillip Williams Jun 19 '17 at 22:57
  • The suggestion of an HttpModule is appreciated, but it would require me to enable RAMMFAR on my server. It is extremely desirable to avoid doing this. I implemented a DelegatingHandler inside my application to let http.sys just pass the content on through to my application but when I attempt to do LZMA decompression with the 7zip sdk, the requests get swallowed by the server and are not being dispatched to my application – K. Alan Bates Jun 20 '17 at 16:12
  • LZMA is not GZip. now I'm sure that 7zip API can handle Gzip. anyway... I think the only other options is to do "file" uploads, like an attachment of a FORM POST. file uploads are much easier then a new HttpModule. Well good luck – Phillip Williams Jun 20 '17 at 16:56
  • ... sorry, I skipped some steps in my explanation. I switched over to testing LZMA (de)compression because I couldn't get a GZipStream to decompress without declaring "The magic number in GZip header is not correct." So for investigation purposes, I'm currently trying to do LZMA declared with Content-Encoding: gzip There isn't anything apparent from my software that would explain why the original gzip stream could not be deserialized, which prompted my question here. Treat my mention of LZMA as irrelevant information for my question. I'm trying to support gzip POST bodies. – K. Alan Bates Jun 21 '17 at 13:05
0

Perhaps I'm misunderstanding, but your web client should be setting Accept-Encoding: gzip in the headers to tell the server that it can accept gzip, should the server wish to (optionally) encode the response. The server on the other hand, adds Content-Encoding: gzip to the header of the response to tell the client that the response has actually been encoded (if indeed it was), and using which encoding mechanism.

None of this to my knowledge has anything to do with which HTTP method you are using, it is the same for GET, PUT, POST, the lot. It is simply used in the headers to communicate metadata about the response.

Reference - see Examples - Compressing with gzip

  • Your client and server interaction model is backwards for my question. Accept-Encoding: gzip is signified by the client that it is able to accept gzipped responses from the server. It is true that the server communicates to the client Content-Encoding: gzip if the response body is gzipped. But the client is the one who sets Content-Encoding: gzip on a POST if it wants to indicate to the server that the POST body being delivered is gzipped. Servers don't typically allow you to POST zipped content by default. That is what I am needing to enable. – K. Alan Bates Jun 20 '17 at 14:01
  • Gotcha! Sorry, I misunderstood the question - yes, even though you said it right there in the bold typeface(!). I'll leave my answer here in case it helps someone else down the track. – pcdev Jun 20 '17 at 14:25
  • Does this page help, or the blog post the answer references? stackoverflow.com/questions/16671216/… – pcdev Jun 20 '17 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.