>From GZipFilter implements HttpServletRequestFilter {

private final ResponseCompressionAnalyzer analyzer;

public boolean service(HttpServletRequest request, HttpServletResponse
response, HttpServletRequestHandler handler)
                throws IOException
{
        HttpServletResponse newResponse = analyzer.isGZipSupported()
                                                                          ? new 
GZIPEnabledResponse(response, request, cutover, analyzer)
                                                                          : 
response;

        return handler.service(request, newResponse);
}
}

with ResponseCompressionAnalyzer being

public boolean isGZipSupported()
{
        if (!gzipCompressionEnabled)
                return false;

        String supportedEncodings = request.getHeader("Accept-Encoding");

        if (supportedEncodings == null)
                return false;

        for (String encoding : 
TapestryInternalUtils.splitAtCommas(supportedEncodings))
        {
                if (encoding.equalsIgnoreCase("gzip"))
                        return true;
        }

        return false;
}

I've read the entire source so far but it's looking pretty conclusive.

Steve.


On 12 September 2011 21:36, Borut Bolčina <borut.bolc...@gmail.com> wrote:
> So, the header takes precedence over production mode setting and the
> tapestry.gzip-compression-enabled?
>
> Is this really the case?
>
> -borut
>
> 2011/9/12 Steve Eynon <steve.ey...@alienfactory.co.uk>
>
>>
>> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ResponseCompressionAnalyzer.html
>>
>> Looks like it has been doing since T5.1.
>>
>> Steve.
>>
>>
>> On 12 September 2011 21:14, Borut Bolčina <borut.bolc...@gmail.com> wrote:
>> > Hi,
>> >
>> > at the moment the only way to configure T5 response compression is via
>> > tapestry.gzip-compression-enabled.
>> >
>> > Should the configuration extend to support checking Accept-Encoding
>> request
>> > header?
>> >
>> > -borut
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to