Class HttpCompression


  • public class HttpCompression
    extends Object
    A class in charge of compressing request responses at the HTTP protocol buffer level.
    • Constructor Detail

      • HttpCompression

        public HttpCompression()
    • Method Detail

      • attemptCompression

        public boolean attemptCompression​(com.google.apphosting.base.protos.RuntimePb.UPRequest request,
                                          MutableUpResponse response)
                                   throws IOException
        Attempt to compress the HttpResponse, using trusted and untrusted headers to determine if the client (or GFE) accepts compression for this response. If the response can be compressed, the response buffer will be cleared and replaced with the compressed response, and uncompressed_size and uncompress_for_client fields will be set. Otherwise, the response will be left untouched.
        Parameters:
        request -
        response -
        Returns:
        true if the response was successfully compressed.
        Throws:
        IOException