Skip to content

Latest commit

 

History

History
70 lines (46 loc) · 3.19 KB

File metadata and controls

70 lines (46 loc) · 3.19 KB
title Azure API Management policy reference - azure-openai-semantic-cache-store
description Reference for the azure-openai-semantic-cache-store policy available for use in Azure API Management. Provides policy usage, settings, and examples.
services api-management
author dlepow
ms.service azure-api-management
ms.collection ce-skilling-ai-copilot
ms.custom
build-2024
ms.topic reference
ms.date 02/23/2026
ms.update-cycle 180-days
ms.author danlep

Cache responses to Azure OpenAI API requests

[!INCLUDE api-management-availability-all-tiers]

The azure-openai-semantic-cache-store policy caches responses to Azure OpenAI Chat Completion API requests to a configured external cache. Response caching reduces bandwidth and processing requirements imposed on the backend Azure OpenAI API and lowers latency perceived by API consumers.

Note

[!INCLUDE api-management-policy-generic-alert]

[!INCLUDE api-management-azure-openai-models]

Policy statement

<azure-openai-semantic-cache-store duration="seconds"/>

Attributes

Attribute Description Required Default
duration Time-to-live of the cached entries, specified in seconds. Policy expressions are allowed. Yes N/A

Usage

Usage notes

  • This policy can only be used once in a policy section.
  • If the cache lookup fails, the API call that uses the cache-related operation doesn't raise an error, and the cache operation completes successfully.
  • [!INCLUDE api-management-cache-rate-limit]

Examples

Example with corresponding azure-openai-semantic-cache-lookup policy

[!INCLUDE api-management-semantic-cache-example]

Related policies

[!INCLUDE api-management-policy-ref-next-steps]