Cache Configuration#
The Janssen Server provides multiple configuration tools to perform these tasks.
Use the command line to perform actions from the terminal. Learn how to use Jans CLI here or jump straight to the Using Command Line
Cache configuration is not possible in Text-based UI.
Use REST API for programmatic access or invoke via tools like CURL or Postman. Learn how to use Janssen Server Config API here or Jump straight to the Using Configuration REST API
Using Command Line#
To get the details of Janssen command line operations relevant to the cache
configuration, you can check the operations under CacheConfiguration
using the command below:
jans cli --info CacheConfiguration
It prints below two operations:
Operation ID: get-config-cache
Description: Returns cache configuration.
Operation ID: patch-config-cache
Description: Patch cache configuration
Schema: Array of JsonPatch
To get sample schema type jans cli --schema <schema>, for example jans cli --schema JsonPatch
Get Cache Configuration#
You can get the current Cache Configuration of your Janssen Server by performing this operation.
jans cli --operation-id get-config-cache
It will show the Cache configuration details.
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
Patch Cache Configuration#
You may need to update Cache configuration, In that case
patch-config-cache
can be used to modify the cache configuration.
Operation ID: patch-config-cache
Description: Patch cache configuration
Schema: Array of JsonPatch
To get sample schema type jans cli --schema <schema>, for example jans cli --schema JsonPatch
The patch-config-cache
operation uses the
JSON Patch schema to describe
the configuration change. Refer
here to know more about
schema.
For instance, to perform a replace
operation at
memcachedConfiguration/bufferSize
and change it from 32768
to 32788
,
the JSON Patch data would look like below:
[
{
"op": "replace",
"path": "memcachedConfiguration/bufferSize",
"value": "32788"
}
]
Store the above JSON Patch data in a file, for instance,
/tmp/patch-cache.json
Using the above file, perform the operation as below:
jans cli --operation-id patch-config-cache --data /tmp/patch-cache.json
Sample Output | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
Quick Patch Operation#
In case you need to do a quick patch operation, you can do that also.
For example, let's say we would like to replace defaultPutExpiration
value from nativePersistenceConfiguration
. We can do that simply by
the following command line:
jans cli --operation-id patch-config-cache \
--patch-replace nativePersistenceConfiguration/defaultPutExpiration:90
It will change the value with the given one. There are few options to do such quick patch operations. Please check them out from here.
Using Configuration REST API#
Janssen Server Configuration REST API exposes relevant endpoints for managing and configuring Cache. Endpoint details are published in the Swagger document.
Created: 2021-04-22