Skip to main content
The Muxx Gateway can cache LLM responses, returning cached results for identical requests. This reduces both latency and costs.

How It Works

When caching is enabled:
  1. The gateway generates a cache key from the request (model, messages, parameters)
  2. If a cached response exists and hasn’t expired, it’s returned immediately
  3. If not, the request goes to the provider and the response is cached

Enabling Caching

Caching is configured per-project in the dashboard:
  1. Go to your project Settings
  2. Navigate to GatewayCaching
  3. Toggle caching on
  4. Set your preferred TTL (time-to-live)

Cache TTL

The TTL determines how long responses are cached:

Cache Keys

The cache key is generated from:
  • Model name
  • Messages/prompt content
  • Temperature (if set)
  • Other generation parameters
Requests with temperature > 0 are still cached, but you may want shorter TTLs since you might want varied responses.

Cache Headers

The gateway adds headers to indicate cache status:

Bypassing Cache

To force a fresh response, add the header:

Cost Savings

Cached responses are free—you only pay for the original request. For applications with repeated queries, caching can significantly reduce costs. Example savings:
  • 1000 requests, 60% cache hit rate
  • Only 400 requests billed to the provider
  • 60% cost reduction

Viewing Cache Stats

In the dashboard, you can see:
  • Cache hit rate over time
  • Cost savings from caching
  • Most frequently cached requests