Package com.google.apphosting.runtime
Class HttpCompression
java.lang.Object
com.google.apphosting.runtime.HttpCompression
A class in charge of compressing request responses at the HTTP protocol buffer level.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
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.
-
Constructor Details
-
HttpCompression
public HttpCompression()
-
-
Method Details
-
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
-