Overview of GoModel response caching
mainGoModel provides two layers of response caching for non-streaming requests on the following endpoints:
/v1/chat/completions/v1/responses/v1/messages/v1/embeddings
Cache Types
- Exact-match cache: Returns byte-identical responses. When a hit occurs, the response includes the header
X-Cache: HIT (exact). - Semantic cache: Uses embeddings and vector search to allow meaning-equivalent prompts to reuse stored responses. When a hit occurs, the response includes the header
X-Cache: HIT (semantic).
Both cache layers operate on the final request sent upstream, meaning they run after workflow and guardrail patching. To bypass caching for a specific request, use the Cache-Control: no-cache or Cache-Control: no-store headers.