Looking for provider-level caching? Learn about Prompt Caching to cache prompts directly on provider servers when supported.
How It Works
Planck builds a cache key from the request path, request body, selected cache headers, and optional cache seed. If a matching entry exists, the gateway can return the cached response. If not, the gateway sends the request to the provider and can store the response for future identical requests. Cache behavior is request-scoped. You opt in withPlanck-Cache-Enabled.
Quick Start
Headers
string
required
Enables response caching for the request. Use
"true" to enable.string
Sets cache duration. Use
max-age=<seconds>, for example max-age=3600.string
Number of different responses to store for the same request key. This is useful for non-deterministic prompts.
string
Creates a separate cache namespace, such as a user id, organization id, environment, or test run id.
string
Comma-separated JSON keys to exclude from cache key generation.
Header values must be strings. For example, use
"Planck-Cache-Bucket-Max-Size": "3".Cache Seeds
Use a seed when the same request body should cache separately for different users, tenants, or environments:Ignore Keys
UsePlanck-Cache-Ignore-Keys for request fields that should not affect the cached response:
Response Headers
When caching is enabled, inspect response headers to understand cache behavior:Limitations
- Caching is intended for eligible JSON gateway requests.
- Streaming cache behavior may differ from non-streaming responses.
- Any non-ignored request body change creates a new cache key.
- Do not cache requests that include sensitive data unless your retention and privacy settings allow it.
Related Features
Prompt Caching
Cache prompts on provider servers for reduced token costs and faster processing.
Custom Properties
Add metadata to requests for filtering and analysis.
Rate Limiting
Control request frequency and combine with caching for cost optimization.
User Metrics
Track usage and savings by user or application.
Need more help?
Need more help?
Additional questions or feedback? Reach out to
help@inquantum.ai or schedule a
call with us.