tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54095] New: [patch] support gzipped versions of static resources by DefaultServlet
Date Sat, 03 Nov 2012 20:49:45 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54095

          Priority: P2
            Bug ID: 54095
          Assignee: dev@tomcat.apache.org
           Summary: [patch] support gzipped versions of static resources
                    by DefaultServlet
          Severity: minor
    Classification: Unclassified
                OS: All
          Reporter: kustos@gmx.net
          Hardware: All
            Status: NEW
           Version: trunk
         Component: Catalina
           Product: Tomcat 8

Created attachment 29546
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29546&action=edit
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:

http://download.eclipse.org/jetty/stable-8/apidocs/org/eclipse/jetty/servlet/DefaultServlet.html

Patch attached with tests and updated documentation.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message