Caching Client in Jersey 2

Multi tool use
Multi tool use


Caching Client in Jersey 2



We are in process of migraring from Jersey 1 to 2. As part of this, I am trying to move caching configurations in Jersey 1.



With Jersey 1, we were using ApacheHttpClient4 which internally was using a ApacheHttpClient4Handler built using CachingHttpClient.


ApacheHttpClient4Handler httpClientHandler = new ApacheHttpClient4Handler(cachingHttpClient, null, false);
javax.ws.rs.client.Client client = new ApacheHttpClient4(httpClientHandler, clientConfig);



But looks like ApacheHttpClient4Handler is not available in Jersey 2.



Question here is, is there an alternative to ApacheHttpClient4Handler available?



I know how caching works as a server (Setting response headers etc). My question here is executing the external cacheable REST requests which my Jersey Client can cache.



Long term goal is to move away with Jersey comletely and use something like RestTemplate. But for now I am trying for a short term solution.



Any help here will be much appreciated.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

uDwfSecpkJagv1FSbJ8 eea H oaLykvomo 3PHmeg,KFKCHKs09c1EFFE S8MSurmZpBzhUgM1
Q,pk3kP1 V1PF98eYOxkhIuh,ATbR31C7

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications