#
Advanced Cache
The Advanced Cache plugin provides the ability to define and configure named caches, which can be used by any Rosetta
feature that retrieves caches by name from the CacheManager
. For instance, they can then be used
to cache different parts of a Data Service multi-request with different caches (e.g. with different ttls)
using one of the Views defined in this plugin.
#
Dependency Information
<dependency>
<groupId>com.k-int.rosetta</groupId>
<artifactId>rosetta-advanced-cache</artifactId>
<version>3.0.0</version>
</dependency>
#
Views
#
advanced-cache
Entity Kind: View
Type: advanced-cache
The advanced-cache
View behaves the same as a data
View
except that the target model for the View request phase is an DataServiceRequest
, allowing the cache details to be specified in the cache
field.
#
Properties
See DataView.
#
advanced-cache-multi
Entity Kind: View
Type: advanced-cache-multi
The advanced-cache
View behaves the same as a data-multi
View
except that the target model for the View request phase is a map whose values are DataServiceRequest
objects, allowing the cache details to be specified independently for each sub-request in their respective cache
fields.
#
Properties
See DataView.
#
Data Structures
#
AdvancedCacheDataRequest
#
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"profile": {
"type": "string"
},
"request": {},
"cache": {
"type": "object",
"properties": {
"key": {
"description": "The key used to cache the response of this request. If null, the full data service request (excluding the cache parameters) will be used."
},
"name": {
"type": "string",
"description": "The name of the cache to be used. If null or equal to 'default', then the default data service cache will be used."
}
}
}
}
}
#
Example
{
"profile": "my-profile",
"request": {
"search_string": "John Smith",
"date_min": "2011",
"date_max": "2020",
"offset": 0,
"limit": 10
},
"cache": {
"key": "John Smith|2011|2020|0|10",
"name": "my-custom-cache"
}
}
#
Configuration Properties
Each of the following properties is prefixed by the property path rosetta.plugins.advanced-cache
.