Compressing a web service response for jQuery

后端 未结 5 1052
轮回少年
轮回少年 2020-12-09 12:41

I\'m attempting to gzip a JSON response from an ASMX web service to be consumed on the client-side by jQuery.

My web.config already has httpCompression set like so:

5条回答
  •  甜味超标
    2020-12-09 13:17

    Eric P's answer is mostly correct... you need to EXACTLY match the Content-Type header sent by IIS in its HTTP Response Headers. For some reason our IIS7 server was responding with: Content-Type: application/json; q=0.5

    I had never ever observed a quality factor in a server response before. How bizarre.

    When we added this to the dynamicTypes in the .config file everything started working:

      
           ...
           
           
           
           
           ...
      
    

提交回复
热议问题