Back to Documentation

Cache Control

Intelligent caching that reduces costs, improves latency, and lets agents ask for fresh data.

Multi-Layer Caching

Response Cache

MCPify gateway cache for API responses. Shared across a tenant's agents, or kept per user where the service calls the API on each user's behalf.

TTL set per tool • Scope: per service (tenant or per user)

Durable Cache

Long-lived cache for responses from append-only APIs.

Cache Invalidation

Agents can ask any cached tool for fresh data from the API:

// tools/call params: skip the cached copy and read from the API
{
  "name": "crm___get_customer",
  "arguments": {
    "id": "cust_123",
    "_freshData": true
  }
}

A write through the gateway clears that service's cached reads for the tenant or user that made it.

Cache Key Strategy

MCPify generates stable, deterministic cache keys:

Key Components

  • • Auth Context: tenant when every call to the service authenticates upstream as the same principal, or an identifier for the forwarded user (for example sub: and a hash) when the data differs per user
  • • Service: the service name
  • • Tool: the tool's full name
  • • Version: the tool's cache version
  • • Arguments: a hash of the call's arguments, keys sorted

They follow the key-format version, in this order:

…api_cache:v1:tenant:crm:crm___list_customers:v1:<argsHash>

Ready to optimize with intelligent caching?

Cache control lets you trade freshness for cost and latency, per tool.