Skip to content

Commit 77215d5

Browse files
authored
Update caching.mdx
caching updates
1 parent f836b21 commit 77215d5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/docs/ai-gateway/configuration/caching.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ To check whether a response comes from cache or not, **cf-aig-cache-status** wil
5151

5252
In order to override the default cache behavior defined on the settings tab, you can, on a per-request basis, set headers for the following options:
5353

54-
### Skip cache (cf-skip-cache)
54+
### Skip cache (cf-aig-skip-cache)
5555

5656
Skip cache refers to bypassing the cache and fetching the request directly from the original provider, without utilizing any cached copy.
5757

58-
You can use the header **cf-skip-cache** to bypass the cached version of the request.
58+
You can use the header **cf-aig-skip-cache** to bypass the cached version of the request.
5959

6060
As an example, when submitting a request to OpenAI, include the header in the following manner:
6161

6262
```bash title="Request skipping the cache"
6363
curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/openai/chat/completions \
6464
--header 'Authorization: Bearer $TOKEN' \
6565
--header 'Content-Type: application/json' \
66-
--header 'cf-skip-cache: true' \
66+
--header 'cf-aig-skip-cache: true' \
6767
--data ' {
6868
"model": "gpt-4o-mini",
6969
"messages": [
@@ -76,9 +76,9 @@ curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/openai/chat/
7676
'
7777
```
7878

79-
### Cache TTL (cf-cache-ttl)
79+
### Cache TTL (cf-aig-cache-ttl)
8080

81-
Cache TTL, or Time To Live, is the duration a cached request remains valid before it expires and requires refreshing from the original source. You can use **cf-cache-ttl** to set the desired caching duration in milliseconds.
81+
Cache TTL, or Time To Live, is the duration a cached request remains valid before it expires and requires refreshing from the original source. You can use **cf-cache-ttl** to set the desired caching duration in seconds. The minimum time to live is 60 seconds.
8282

8383
For example, if you set a TTL of one hour, it means that a request is kept in the cache for an hour. Within that hour, an identical request will be served from the cache instead of the original API. After an hour, the cache expires and the request will go to the original API for a more recent response, and that response will repopulate the cache for the next hour.
8484

@@ -88,7 +88,7 @@ As an example, when submitting a request to OpenAI, include the header in the fo
8888
curl https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/openai/chat/completions \
8989
--header 'Authorization: Bearer $TOKEN' \
9090
--header 'Content-Type: application/json' \
91-
--header 'cf-cache-ttl: 3600000' \
91+
--header 'cf-aig-cache-ttl: 3600' \
9292
--data ' {
9393
"model": "gpt-4o-mini",
9494
"messages": [

0 commit comments

Comments
 (0)