How can I generate and clear the cache?
Interceptors are in charge of controlling cache usage in responses to API requests.
To create a cache and use it in calls, you need to use a pair of interceptors:
-
Cache Write is used to create the cache; and
-
Cache Read is used to get stored responses from the cache that was created.
To clear the cache, you can use the Cache Invalidation interceptor. |
How it works
-
Cached responses are configured at the level of operations. Thus, if you’re editing the flow of an API and you can’t find any cache interceptors, check the field Operations, above the flow depiction. If you selected the option "All", the cache interceptors will not be displayed. In that case, select a specific operation to view the interceptors and, if desired, drag them into the flow.
-
To cache a response, the Cache Write interceptor must be inserted into the response flow of an operation. If the request is successful, the Manager will create a cache based on the configurations entered. For the system to use the response stored in memory, you must include the Cache Read interceptor in the operation’s request flow.
-
The "Cache Name" you configure must be the same for both interceptors.
-
To delete the response stored in memory, insert the Cache Invalidation interceptor into the request or response flow of an operation, with the "Cache Name" configured as in the Cache Write and Cache Read interceptors.
-
-
To clear the entire cache or control its volume, go to
. The page only appears if your user has the "Cache Control" permission.
Check the documentation about cache control. |
In cases where the response is handled by a Custom Interceptor, it’s necessary to use another Custom Interceptor to interrupt the flow when the Cache Read is populated. This prevents cache treatment error from occurring. The interceptor that will interrupt the flow must be inserted in any position after the Cache Read interceptor. |
Share your suggestions with us!
Click here and then [+ Submit idea]