Caching
How Marvin2 response caching works for classification and repeat requests.
X-Marvin2-Cache header
POST /marvin2 (classification) returns a cache header on every successful response. Other Marvin2 endpoints (for example POST /co-tenant) do not use this header today.
Classification responses include:
X-Marvin2-Cache: HIT
or
X-Marvin2-Cache: MISS
| Value | Meaning |
|---|---|
HIT | This response was returned from cache — the same request was classified recently. |
MISS | This response was generated fresh and saved for future matching requests. |
Log HIT and MISS in your integration to explain latency differences and to verify deduplication in batch runs.
When responses are cached
Caching is based on the full request body. If every meaningful field matches a previous call — company name, location, predictionType, responseConfig, searchMode, and the rest — you should see a HIT.
Change any value in the body and you should expect a MISS and a new classification.
Only successful responses are cached. Errors are not stored.
Repeat requests
Batch and replay jobs — Re-running the same file often produces many HIT responses and much lower latency than the first pass.
Live underwriting — When a user edits company details, update the request body so the service can return an updated classification.
Need a fresh result? — Change something material in the request (for example, add a description or adjust responseConfig). If you need guaranteed fresh runs on every call, contact Relativity6 support.
Quota and billing
- A
MISSruns a full classification and typically counts toward your quota like a normal request. - A
HITreturns a stored answer without running classification again. How cache hits affect quota depends on your organization's agreement — confirm with your account team if cost control matters.
Include responseId and the cache header value when contacting support.