1. I have corrected the e-mail settings so that outgoing e-mails from these forums should be sent now. If you tried to Register or Reset your Password, please try again!
    Dismiss Notice

HTTP Compression

Discussion in 'Census: General Discussion' started by DanKinney, Feb 10, 2012.

  1. DanKinney

    DanKinney Guest

    If you are making calls to the REST API from a server process, you should consider enabling HTTP Compression on your request. This is already enabled for most browsers, but you need to set an HTTP header when requesting through code.

    Accept Encoding: gzip

    This will reduce the transfer size of a character request dramatically.

    More information about HTTP Compression may be found here.

    -dan

     
  2. Lempo

    Lempo Guest

    If anyone is using any PHP 5+ this should be being handled automatically, I had to make no configuration changes. I use fiddler and it has always reported gzip incoming.

    Also AWESOME change for the search by name on a lower case indexed field, have not tried it but I have no doubts it will make a huge difference.

     
  3. Quicktiger

    Quicktiger Guest

    Ruby's library also does this by default:

    <span style="white-space: pre;"> Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3

    It seems, however, that XML and YAML are compressed, and JSON responses are not.

     
  4. Lantis

    Lantis Guest

    When using Curl under PHP, you have to set an empty CURLOPT_ENCODING to automatically send the list of all supported encoding types in the request header (which will include gzip):

    Code:
            curl_setopt($curlResource, CURLOPT_ENCODING, "");
    Otherwise, no Accept-Encoding header gets sent.

     
  5. DanKinney

    DanKinney Guest

    We will investigate the JSON response on Monday.  

    -dan

     
  6. DanKinney

    DanKinney Guest

    This was a simple configuration change.  It is working for json and jml.

    -dan

     

Share This Page