...
Policy Execution Order
Architecture
Persist a Response Cache Map in the Gateway Resource.
Each key-value pair in the Response Cache Map will be:
Code Block |
---|
{ |
...
policy_instance_id: Google Guava Cache, |
...
... |
...
} |
Each Google Guava Cache will have has the key-value pairs:
Code Block |
---|
{ |
...
[ Hash Hex of params specified by policy ]: Cached HTTP Response |
...
... |
...
} |
Each Cached HTTP Response will hold contains the following information:
Original HTTP Response Object for preserving the flow of handling HTTP responses in the Gateway Resource.
byte[]
of the response content to preserve the stream that cannot be rewound.
Expired caches cannot be accessed and new entries
...
overwrite any existing ones.
policy version
to determine if the policy has been updated since the last save. An update to the policy will direct the flow to acquire a new HTTP response and overwrite the existing
...
The persisted HTTP response will leverage the existing Gateway Resource flows so that response policies and compressions can be applied the cached HTTP response it as if it were a regular HTTP response that is acquired from a normal HTTP request (without a caching policy).
Provide a maintenance routine to clear out invalidated caches every 12 hours.
one.
Limitations
We do limit the response cache to have a response less than the MAX_CACHE_BYTES which is a feature flag default to a value of 90000000 bytes which is equivalent to 85.83 MB (edited)
...
Parameter Name | Description | Default Value |
---|---|---|
Label | Required. The name for the API policy. | HTTP Respone Cache |
When this policy should be applied | An expression-enabled field that determines the condition to be fulfilled for the API policy to execute. For example, if the value in this field is | N/A |
Cache Interval | The time period of the current cache before it is refreshed. | 1 |
Time Unit | The time unit for the Cache Interval value. | Hour |
Use HTTP Request Headers to Create Cache Keys | Enables the use of specific headers to identify a cache. | Unselected |
Use HTTP Request Query Parameter to Create Cache Keys | Enables the use of query parameters to identify a cache. | Unselected |
Status | Specifies whether the API policy is enabled or disabled. | Enabled |
...