Package com.google.apphosting.runtime
Class HttpCompression
- java.lang.Object
-
- com.google.apphosting.runtime.HttpCompression
-
public class HttpCompression extends Object
A class in charge of compressing request responses at the HTTP protocol buffer level.
-
-
Constructor Summary
Constructors Constructor Description HttpCompression()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
attemptCompression(com.google.apphosting.base.protos.RuntimePb.UPRequest request, MutableUpResponse response)
Attempt to compress the HttpResponse, using trusted and untrusted headers to determine if the client (or GFE) accepts compression for this response.
-
-
-
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
-
-