tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 54095] New: [patch] support gzipped versions of static resources by DefaultServlet
Date Sat, 03 Nov 2012 20:49:45 GMT

          Priority: P2
            Bug ID: 54095
           Summary: [patch] support gzipped versions of static resources
                    by DefaultServlet
          Severity: minor
    Classification: Unclassified
                OS: All
          Hardware: All
            Status: NEW
           Version: trunk
         Component: Catalina
           Product: Tomcat 8

Created attachment 29546
patch that supports gzipped versions of files

If you want to serve gzipped versions of files you often use a filter, valve or
enable compression attribute on the connector. However this is suboptimal for
several reasons. Compression has to be done in memory so the whole content has
to be loaded into memory, the result is not cached meaning compression has to
be done over agin and sendfile can't be used.

The most efficient way to implement gzip serving to generate gzipped versions
of the resources at build time. Then use a custom filter that forwards to the
gzipped version if the user agent supports it. This way sendfile can be used
and compression is only done once at build time.

It would be nice if the DefaultServlet detected that there's a gzipped version
of the resource and serves it when the client supports it. The Jetty
DefaultServlet does exactly this:

Patch attached with tests and updated documentation.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message