November 2017
Intermediate to advanced
420 pages
10h 29m
English
With server-side caching, the client will still have to hit the target resource. When the bandwidth is a constraint and there is a requirement to save network-round trips, it makes sense to enable caching at the client side when the consuming system has enough resources required for caching. The HTTP 1.1 protocol specification defines the guidelines around client-side caching with control parameters such as cache-control headers to decide about caching the server response and the cache-expiry mechanisms.
Following the HTTP specification, RESTEasy provides the BrowserCacheFeature API for implementing client-side caching, as shown ahead:
//Enabling Client-Side Caching public DepartmentServiceClient(){ webTarget = (ResteasyWebTarget) ...