You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/03/26 17:38:21 UTC

DO NOT REPLY [Bug 48998] New: Proposal : port mod_expires in java as ExpiresFilter Servlet Filter

https://issues.apache.org/bugzilla/show_bug.cgi?id=48998

           Summary: Proposal : port mod_expires in java as ExpiresFilter
                    Servlet Filter
           Product: Tomcat 7
           Version: trunk
          Platform: PC
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: cleclerc@pobox.com


Created an attachment (id=25189)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25189)
Port of mod_expires as ExpiresFilter

Here is a proposal to port Apache Httpd mod_expires in java as ExpiresFilter, a
standard Servlet Filter.

I detailed a standalone version on
http://code.google.com/p/xebia-france/wiki/ExpiresFilter . More over, I tried
my best to provide very detailed javadocs and docs (in filter.html).

The proposed contribution is slightly different because it uses Tomcat logging,
few Servlet 3 enhancements and test cases use Tomcat engine.

The attached patch contains :
* ExpiresFilter.java : the Expires Filter
* TestExpiresFilter : detailed test cases
* filter.xml : doc updates

The filter has been optimized using a profiler and stress tested with Apache
Bench under high load.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48998] Proposal : port mod_expires in java as ExpiresFilter Servlet Filter

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48998

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Mark Thomas <ma...@apache.org> 2010-07-14 18:16:23 EDT ---
Thanks for the patch. I have applied it to trunk and it will be included in
7.0.1 onwards.

I did make a few changes:
- fixed various Eclipse warnings
- removed the active option

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48998] Proposal : port mod_expires in java as ExpiresFilter Servlet Filter

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48998

--- Comment #2 from sylvain.laurent@gmail.com 2010-03-29 18:40:43 UTC ---
why not use http://tuckey.org/urlrewrite/ ? it can do this and many other
things...

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48998] Proposal : port mod_expires in java as ExpiresFilter Servlet Filter

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48998

Cyrille Le Clerc <cl...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #25189|0                           |1
        is obsolete|                            |

--- Comment #1 from Cyrille Le Clerc <cl...@apache.org> 2010-03-29 18:17:29 UTC ---
Created an attachment (id=25208)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25208)
Port of mod_expires as ExpiresFilter with optimized null checks

This patch slightly smaller than previous .patch file because the previous
.patch file included twice TestExpiresFilter.java.

Changes in this patch:
* ExpiresFilter.java : reduce null checks for speed optimization,
* filter.xml : add a comment in to warn users not to declare blank chars
between ';' and 'charset=' for 'ExpiresByType' directives,
* TestExpiresFilter.java : narrow the precision interval in cache-control
checks.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 48998] Proposal : port mod_expires in java as ExpiresFilter Servlet Filter

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48998

--- Comment #3 from Cyrille Le Clerc <cl...@apache.org> 2010-03-29 19:02:39 UTC ---
(In reply to comment #2)
> why not use http://tuckey.org/urlrewrite/ ? it can do this and many other
> things...

My understanding is that the UrlRewriteFilter can add response headers (e.g.
'Expires' and 'Cache-Control') according to request attributes like a URI
pattern (e.g. *.html).

However, I don't see how I could express something like "if the response
content type is 'application/rss+xml' and if no expiration header has been
defined, then add an expiration of 5 minutes".

A challenge I see in this kind of feature is to apply the
expiration-header-generation logic just before the servlet engine starts to
write in the response body in the socket.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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