public interface CacheManager
DeliveryClient.
An implementation of this can be provided via DeliveryClient.setCacheManager(CacheManager) and it is invoked
before every API request. It is expected to return a JsonNode representation of the API response.
It is up to the CacheManager to determine how to key it's cache, and how much it will introspect the JsonNode,
however due to varying operations that can be done with the DeliveryParameterBuilder, it is highly
recommended to key off the requestUri.
A CacheManager also can leverage notifications from Kontent's webhooks that can be sent when the project's content is changed.
By default, if no CacheManager is provided, the DeliveryClient will use it's default, which just passes through.
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JsonNode |
get(java.lang.String url)
Retrieve an earlier cached response from the Kontent.ai Delivery API.
|
void |
put(java.lang.String url,
com.fasterxml.jackson.databind.JsonNode jsonNode,
java.util.List<ContentItem> containedContentItems)
Cache a response from the Kontent.ai Delivery API.
|
com.fasterxml.jackson.databind.JsonNode get(java.lang.String url)
url - The url that would be used to retrieve the response from Kontent.ai Delivery API.void put(java.lang.String url,
com.fasterxml.jackson.databind.JsonNode jsonNode,
java.util.List<ContentItem> containedContentItems)
url - the URL that was used to retrieve the response from the Kontent.ai Delivery API.jsonNode - the JsonNode created from the response from the Kontent.ai Delivery API.containedContentItems - (null allowed) can be used to inspect the original contents of the JsonNode and allow for precise cache invalidation (if implemented).