|
From: Baum, K. <Kar...@Ta...> - 2004-07-02 16:13:28
|
I originally posted this response the users list, but I think it may be = more appropriate for the developer's list. I apologize if it's a = repeat. Thanks. =20 Karl ________________________________ From: spr...@li... on behalf of = Baum, Karl Sent: Fri 7/2/2004 7:50 AM To: spr...@li... Subject: RE: [Springframework-user] Cache HandlerInterceptor My main issue with putting the caching logic within a Filter is that my = Filter must run in front of all of my Spring HandlerInterceptors. When = I have a cache hit in my filter, none of the HandlerInterceptors will = run. Right now we have some auditing logic tracking site visits. This = logic must always run even if the page is cached. Because I cannot = cache from within Spring, I must move the auditing logic out of the = HandlerInterceptor and into another java Filter, losing the IOC benefits = of the Spring container. I think the HandlerInterceptors are well designed and easy to use, but I = can see some definite benefit to allowing content caching. Any = thoughts? -----Original Message----- From: spr...@li... = [mailto:spr...@li...] On Behalf Of = j=FCrgen h=F6ller [werk3AT] Sent: Friday, July 02, 2004 2:41 AM To: spr...@li... Subject: Re: [Springframework-user] Cache HandlerInterceptor The HandlerInterceptor mechanism was deliberately not designed for that = sort of usage. I suggest to stick to a Servlet Filter for any kind of = response content wrapping, like compressing or caching. Regarding caching in particular: You can achieve nice benefits through = setting appropriate HTTP headers; see Spring's AbstractController and = WebContentInterceptor which allow to do this in a declarative fashion. = Another option is last-modified support: Implement the LastModified = interface in your Controller, causing the browser to cache last-modified = timestamps and asking "if-modified-since" instead of expecting the = content on each request. Juergen ________________________________ Von: spr...@li... im Auftrag von = Baum, Karl Gesendet: Fr 02.07.2004 02:48 An: spr...@li... Betreff: [Springframework-user] Cache HandlerInterceptor Is there an easy way to implement a HandlerInterceptor for caching web content? This is easily done in a Filter by wrapping the the Response object, but there does not seem to be a hoook for this in an Interceptor. Thanks. Karl ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Springframework-user mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-user ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Springframework-user mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-user ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Springframework-user mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-user |