How to clear Content Cache Policy content

Solution Verified - Updated -

Environment

  • Red Hat 3scale API Management
    • 2.X On-premises

Issue

  • How to clear content cache populated by APIcast Content Cache Policy

Resolution

The Content cache is stored in /tmp/cache directory in apicast.

$ oc rsh <apicast> 
sh-4.2$ ls /tmp/cache

A cache entry is stored in a file in the following directory tree structure

/tmp/cache/f/07/7ab20d614e88683e6e2a48ee3869f07f

There is a KEY stored along with the response in the file.

The cache entries can be cleared out using one the following

  1. Do a rollout of apicast pod. This will clear the cache i.e. empty the entire tree of cache entries in /tmp/cache.

  2. Wait for 10 mins. Cache entry will be removed regardless of it is expired or not. ONly the file ( leaf) is remove but directory structure will remain. In the above example, after 10 mins you will see the following

    /tmp/cache/f/07
    
  3. Search for an entry by KEY and remove manually.

Root Cause

How to clear content cache used by APIcast Content Cache Policy is not described in the documentation.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments