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, it is necessary to use a pair of interceptors: o Cache Write is used to create the cache and Cache Read is used to get stored responses from the cache that was created. In order to clear the cache, you can use the Cache Invalidation interceptor.
Let’s understand how each stage works.
First of all, keep in mind that 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. Note that 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 (as well as control the cache volume), go to here.
(the page only appears if your user has the "Cache Control" permission — by default, only Super Admins have it). See more about cache controlIn 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]