Disable caching at the API Gateway by adding the following entry under the
APIGateway>element in the
Code Block language xml
Enable the Key Manager cache by adding the following entry under the
APIKeyValidator>element in the api-manager.xml file.
You sometimes pass certain enduser attributes to the backend using JSON Web Tokens (JWT). The token is generated in the Key Manager server for each validation information object and is sent as part of the key validation response. Enable token generation by setting the following entry to
true at the root level of the
<APIConsumerAuthentication> <EnableTokenGeneration>true</EnableTokenGeneration> </APIConsumerAuthentication>
The OAuth token is saved in this cache, which is enabled by default. Whenever a new OAuth token is generated, it is saved in this cache to prevent constant database calls. Unless an OAuth expires or is revoked, the same token is sent back for the same user. Therefore, you do not need to change this cached token most of the time.
To change the default response caching settings, edit the following cache mediator properties in
|Specifies the maximum size of a message to be cached in bytes. An optional attribute, with the default value set to |
|maxSize||Defines the maximum number of elements to be cached|
Defines the hash generator class.
When caching response messages, a hash value is generated based on the request's URI, transport headers and the payload (if available). WSO2 has a default
If you want to change this default implementation (for example, to exclude certain headers), you can write a new hash generator implementation by extending the
API Store cache
The API Store has several caches to reduce the page-load times and increase its responsiveness when multiple users access it simultaneously.