aurora-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Farner" <wfar...@apache.org>
Subject Re: Review Request 18658: GZIP HTTP thrift API responses
Date Mon, 03 Mar 2014 21:07:40 GMT


> On March 1, 2014, 5:23 p.m., Bill Farner wrote:
> > src/main/java/org/apache/aurora/scheduler/thrift/ThriftModule.java, line 40
> > <https://reviews.apache.org/r/18658/diff/2/?file=507574#file507574line40>
> >
> >     I can't think of a good reason to not apply this to /, can you?  If so, the
filter should probably be applied in a different module.
> 
> Kevin Sweeney wrote:
>     From the docs:
>     
>      * This filter will gzip the content of a response iff: <ul>
>      * <li>The filter is mapped to a matching path</li>
>      * <li>The response status code is >=200 and <300
>      * <li>The content length is unknown or more than the <code>minGzipSize</code>
initParameter or the minGzipSize is 0(default)</li>
>      * <li>The content-type is in the comma separated list of mimeTypes set in
the <code>mimeTypes</code> initParameter or
>      * if no mimeTypes are defined the content-type is not "application/gzip"</li>
>      * <li>No content-encoding is specified by the resource</li>
>      * </ul>
>      
>     I'm not certain that generally applies to the whole application (/health for example
probably shouldn't be gzipped).

That doc defines the server-dependent details needed to enable gzip.  The client still needs
to set 'accept-encoding', which i think does make it apply universally.

>From org.mortbay.servlet.GzipFilter:

        String ae = request.getHeader("accept-encoding");
        Boolean gzip=(Boolean)request.getAttribute("GzipFilter");
        if (ae != null && ae.indexOf("gzip")>=0 && !response.containsHeader("Content-Encoding")
&&
            (gzip==null || gzip.booleanValue()) && !"HEAD".equalsIgnoreCase(request.getMethod()))
        {
          // snip
        }
        else
        {
            super.doFilter(request,response,chain);
        }


- Bill


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/18658/#review35907
-----------------------------------------------------------


On March 1, 2014, 1:27 a.m., Kevin Sweeney wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18658/
> -----------------------------------------------------------
> 
> (Updated March 1, 2014, 1:27 a.m.)
> 
> 
> Review request for Aurora, Suman Karumuri and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> GZIP HTTP thrift API responses
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/thrift/ThriftModule.java 12113532eb062308af3c43458661c7b43b23237f

>   src/main/resources/org/apache/aurora/scheduler/http/ui/js/services.js 94189642a4f35aa0cad8176589cfbd84964c2e14

> 
> Diff: https://reviews.apache.org/r/18658/diff/
> 
> 
> Testing
> -------
> 
> Verified API responses are gzipped.
> 
> 
> Thanks,
> 
> Kevin Sweeney
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message