Summary: | Proposal : port mod_expires in java as ExpiresFilter Servlet Filter | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Cyrille Le Clerc <cleclerc> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | trunk | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Mac OS X 10.4 | ||
Attachments: |
Port of mod_expires as ExpiresFilter
Port of mod_expires as ExpiresFilter with optimized null checks |
Description
Cyrille Le Clerc
2010-03-26 16:38:18 UTC
Created attachment 25208 [details]
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.
why not use http://tuckey.org/urlrewrite/ ? it can do this and many other things... (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. 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 |