title: Gzip compresses but doesn't speed up download of JSON output from a Spring MVC Rest API
body: <p>I have a Spring MVC Application running on tomcat 7, which returns a large ( 4 Mb) JSON response to a REST API request. Using Chrome developer tools, I traced that the download on average takes about 2.9 seconds. To speed things up and reduce data usage, I enabled gzip encoding, first using tomcat compression (and later using apache mod_deflate). </p>
  
  <p>During both time, I saw the file size reduce to about 250Kb. The request headers had gzip and chunked encoding flags set. However, the network transfer time did not decrease (in fact on average, I think i saw a very small increase).</p>
  
  <p>Does this make sense to you? I'm trying to figure out why the transmission speed is unchanged with the file size change. If this is insufficient information, let me know what data exactly would be good to make this question more constructive. Should I be using custom servlets with GZipOutputStream instead? (id like to know why if that's the right approach)</p>