Spring for Android
  1. Spring for Android
  2. ANDROID-60

Improve efficiency of gzip requests in RestTemplate

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Works as Designed
    • Affects Version/s: 1.0.0.M4
    • Fix Version/s: 1.0.0.RC1
    • Component/s: rest-template
    • Labels:
      None

      Description

      A new GZIPOutputStream is being created on each call to getBody() in AbstractClientHttpRequest. Consider ways to make this more efficient.

        Activity

        Hide
        Roy Clarkson added a comment -

        Related to ANDROID-59

        Show
        Roy Clarkson added a comment - Related to ANDROID-59
        Hide
        Roy Clarkson added a comment - - edited

        The AndroidHttpClient (based on the apache DefaultHttpClient) has built in support for gzip responses. This is only available in Android 2.2 and higher, though. HttpURLConnection also supports gzip responses, so I think it is worth exploring leveraging these where available.

        Show
        Roy Clarkson added a comment - - edited The AndroidHttpClient (based on the apache DefaultHttpClient) has built in support for gzip responses. This is only available in Android 2.2 and higher, though. HttpURLConnection also supports gzip responses, so I think it is worth exploring leveraging these where available.
        Hide
        Roy Clarkson added a comment -

        getBody() should only be called once on a request object, so there is no inefficiency in creating a new GZIPOutputStream when this method is called.

        Show
        Roy Clarkson added a comment - getBody() should only be called once on a request object, so there is no inefficiency in creating a new GZIPOutputStream when this method is called.

          People

          • Assignee:
            Roy Clarkson
            Reporter:
            Roy Clarkson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: