Since SuperAPI is able to watch incoming API calls, we can monitor all POST / PUT / PATCH API calls that could modify your cached API responses.

For example, take a GET /products/product-1  API that fetches a list of products. And a PUT /products/description that modifies the product descriptions.

So if the GET API is cached, it has to be invalidated every time this POST API comes through.

In this example, assuming that the PUT body contains the ID of the product, you can configure SuperAPI to look for the request.json.product_id key of all incoming PUT requests, and invalidate the corresponding cached GET API if a matching product ID is found.

api-based cache invalidation