[undertow-dev] Caching Proxy / Proxy Extensions

Stuart Douglas sdouglas at redhat.com
Mon Apr 28 20:36:45 EDT 2014



Ronny Karallus wrote:
> Hi Undertow Team,
>
> I just took a quick glimpse into Undertow, to be honest, as I was just
> evaluating it for a project. I planed to use it as a standalone reverse
> proxy including caching and SSI as an alternative to apache.
>
> However, as far as I saw this is not yet a feature set available in
> Undertow. Anyway, I am not worried to get my hands dirty and add a bit
> of code myself, so I looked a bit closer onto the proxy example and the
> underlying classes.
>
> As far as I saw it should be possible to add a CacheHandler in front of
> the ProxyHandler that just uses the proxy handler in case of a miss.
> However, I did not find a good way to hook into the Proxy Handler (it's
> also final :( ) to extend its functionality to store the response in the
> cache.

There are currently two options here. One would be to implement some 
kind of caching ProxyClient implementation that delegates to a real 
ProxyClient, however this would probably be a fair amount of work, and 
not a great solution as the ProxyClient API is really not designed to be 
wrapped in this way.

The other way would be to use 
io.undertow.server.handlers.cache.CacheHandler. The intention of this 
handler was to be a generic caching handler, however it does still need 
some work (which is why it is not present in the Handlers utility class).

If you file a JIRA about this I will add something to allow this in the 
1.1 branch, I think we need some kind of a 'client interceptor' concept, 
to allow for the request and response to be modified.

Stuart

>
> Is there any way to do this? I'd love to have a hook on each processor
> that enables the developer to add response processors. There I could add
> the cache storage and also the SSI processing. Is something like this
> planed or already available and just overlooked by me?
>
> Appreciate your time
>
> Best Regards
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list