You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by samsamsam <po...@gmail.com> on 2011/09/26 06:38:26 UTC

Can a cache back WebClient so making Conditional GETs is easy

I read in one of Sergey's blog mentioning that WebClient acts as a browser.
It even has back(), reset(), forward() etc.

Doesn't it make sense to somehow plugin a cache(ehcache?) that holds the
response and expires/max-age/etag/last-modified headers and intelligently
query the backend using a Conditional GET and take care of 304s elegantly?
Or is there a way to accomplish this already?

If not, I may need to write some boilerplate code, which I'm trying to
avoid.

--
View this message in context: http://cxf.547215.n5.nabble.com/Can-a-cache-back-WebClient-so-making-Conditional-GETs-is-easy-tp4840178p4840178.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Can a cache back WebClient so making Conditional GETs is easy

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 26/09/11 05:38, samsamsam wrote:
> I read in one of Sergey's blog mentioning that WebClient acts as a browser.
> It even has back(), reset(), forward() etc.
>

On reflection, given some discussions we've had recently about different 
forms of client API, I think it can be more accurate to say that in CXF 
JAX-RS client API we attempt to capture the usual experience of the user 
browsing the web, WebClient kind of tries to impersonate a human user 
and emulate the way the user 'moves' in the browser and selects actions

> Doesn't it make sense to somehow plugin a cache(ehcache?) that holds the
> response and expires/max-age/etag/last-modified headers and intelligently
> query the backend using a Conditional GET and take care of 304s elegantly?
> Or is there a way to accomplish this already?
>
> If not, I may need to write some boilerplate code, which I'm trying to
> avoid.
>
That can probably implemented as a CXF feature (a combination of in/out 
interceptors)... If you have some boilerplate code in place then may be 
we can ship such a feature ?

Thanks, Sergey

> --
> View this message in context: http://cxf.547215.n5.nabble.com/Can-a-cache-back-WebClient-so-making-Conditional-GETs-is-easy-tp4840178p4840178.html
> Sent from the cxf-user mailing list archive at Nabble.com.