Cache Interceptor - getheimdall/heimdall GitHub Wiki

Definition

The Cache interceptor is usually used in tandem with the Cache Clear Interceptor to provide the caching of requests. When this interceptor is triggered it will only call your back end if a cache is unavailable. Once the response is cache it will return the cached response.

Details

Cache

Name: Simple name for your interceptor

Description: A simple description for your interceptor

Life Cycle: The appropriate life cycle for the interceptor

  • Life cycles allowed:
    • Api
    • Plan
    • Resource
    • Operation

Content: Configuration of the interceptor

JSON example:

{
  "cache": "cache-name",
  "timeToLive": 10000,
  "headers": [
    "header1",
    "header2"
  ],
  "queryParams": [
    "queryParam1",
    "queryParam2"
  ]
}

cache: a simple cache name

timeToLive: how long the cache should live (in milliseconds)

headers: list of headers that should be checked to create the cache

queryParams: list of query params that should be checked to create the cache