Search code examples
javahttpcachingclientcache-control

Use cache-control header in a java client


From a Java application, using CXF, I call rest web services.
The rest ws respond using HTTP Headers 1.1 cache-control (max-age, no-cache ...).

From the java client, how can I use these headers?
Are there any framework / tool / example to use them and to cache data as it should?

All the articles I could find only talk about the creation of these server-side headers, but nothing on client side.

UPDATE :
In fact, the question is :
is there any tool to help implement in a java client the same behavior as in a browser to process cache-control header ?


Solution

  • Are there any framework / tool / example to use them and to cache data as it should?

    If you're asking for a software library recommendation of a Java HTTP client library that respects Cache-Control in server responses, then:

    Both libraries are Apache-licensed and supported.