# File lib/new_relic/agent/new_relic_service.rb, line 164
      def compress_request_if_needed(data)
        encoding = 'identity'
        if data.size > 64 * 1024
          encoding = Agent.config[:compressed_content_encoding]
          data = if encoding == 'gzip'
            Encoders::Compressed::Gzip.encode(data)
          else
            Encoders::Compressed::Deflate.encode(data)
          end
        end
        check_post_size(data)
        [data, encoding]
      end