Re: Use of suffix in generating key when using CacheFilter

Chris Miller <[email protected]>
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <[email protected]>
I don't think it makes much sense to overload the doFilter() method with 
an extra parameter - how would that method even get called?

Better would be to have a request attribute that allowed the cache key 
to be overridden completely (with perhaps some configurable control over 
the MD5 encoding). If you have a look at the end CACHE-58 there's a 
request for something similar (although for different reasons).

Could you please open this as a separate Jira issue so it doesn't get 
forgotten (since CACHE-58 is really 3 issues in one)?

In the meantime you should be able to write your own replacement filter 
that does what you're after without too much trouble.

Chris


Chico Charlesworth wrote:

> Hi guys,
> 
> I've got a small issue with the CacheFilter class.
> 
> I'm trying to extend the CacheFilter whereby i can do some pre-caching
> operations.
> What i want to do is apply a network filter before calling the cache filter,
> which will tell me which customer base i'm dealing with (via ip address
> matching), and then add a suffix to the cache key generated, therefore
> caching different results per customer base.
> 
> In ServletCacheAdministrator there is a possibility to pass a suffix
> parameter when generating a key, so it would be nice if possible that the
> CacheFilter had a mechanism in place to pass in a suffix (e.g. have a method
> doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse
> response, javax.servlet.FilterChain chain, String suffix)).
> 
> Any possibility this could be done?
> chico.



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.