Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 911D3D81E for ; Sat, 3 Nov 2012 20:50:08 +0000 (UTC) Received: (qmail 88447 invoked by uid 500); 3 Nov 2012 20:50:07 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 88358 invoked by uid 500); 3 Nov 2012 20:50:07 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 88349 invoked by uid 99); 3 Nov 2012 20:50:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Nov 2012 20:50:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Nov 2012 20:50:06 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id B71DFA251; Sat, 3 Nov 2012 20:49:46 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: [Bug 54095] New: [patch] support gzipped versions of static resources by DefaultServlet Date: Sat, 03 Nov 2012 20:49:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 8 X-Bugzilla-Component: Catalina X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: kustos@gmx.net X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: ---- X-Bugzilla-Changed-Fields: priority bug_id assigned_to short_desc bug_severity classification op_sys reporter rep_platform bug_status version component product Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org 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