-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Cyrille,
On 3/26/2010 12:43 PM, Cyrille Le Clerc wrote: > I have proposed with bugzilla 48998 a port of Apache mod_expires in > Java as ExpiresFilter Servlet Filter. Cool. > I detailed a standalone version of this filter on > http://code.google.com/p/xebia-france/wiki/ExpiresFilter . Moreover, I > tried my best to provide very detailed javadocs and docs (in filter.html). > > The proposed contribution is slightly different than the standalone > one because it uses Tomcat logging, few Servlet 3 enhancements and > Tomcat engine in the test cases. I read-through your code on code.google.com and I can see a couple areas where I think improvements might be made: - - In getExpirationDate, you check for the local 'configuration' being null several times in a row. In each case, the configuration may be set given a different 'level' of configuration. If the configuration gets set, several checks must still be made to see if it is null. You could mail out early and avoid some of these checks like this: if(configuration == null) { configuration = ...; if(configuration == null) { // try another strategy configuration = ...; if(configuration == null) { ... } } } I think can save a bit of CPU time without much in the way of code complexity. - - You might be able to wrap the Response class and check for the setting of the Content-Type header, instead of wrapping the response in order to intercept the first buffer flush to the client. Do you think that would work? It certainly would remove a lot of complexity from your code. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkuwqQwACgkQ9CaO5/Lv0PDdwgCgrSHwmgUTDWybmk6/G1+AqNzY kCQAn0zVrQBARihaoQkfBJRtKYkjvsjs =kBWG -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org