AI Search - Control AI Search similarity cache freshness
- Announced
- Tags
- AI-Search
- Severity
- info, set by
reef/rss-rule-v1 - Source
- https://developers.cloudflare.com/changelog/post/2026-06-24-ai-search-similarity-cache-controls/
<p><a href="https://developers.cloudflare.com/ai-search/">AI Search</a> now gives you more control over <a href="https://developers.cloudflare.com/ai-search/configuration/retrieval/cache/">similarity cache</a> freshness. Similarity cache helps reduce latency and inference cost by reusing responses for semantically similar queries.</p> <p>With these updates, you can choose how long responses are eligible for reuse and clear cached responses when they may be stale.</p> <div tabindex="-1" class="heading-wrapper level-h4"><h4 id="cache-duration-now-defaults-to-48-hours">Cache duration now defaults to 48 hours</h4><a class="anchor-link" href="#cache-duration-now-defaults-to-48-hours"><span aria-hidden="true" class="anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span></a></div> <p>Previously, AI Search cached responses for a fixed duration of 30 days. Cached responses now use the instance's <code>cache_ttl</code> setting, and the default is <strong>48 hours</strong>.</p> <p>You can set <code>cache_ttl</code> when creating or updating an instance to choose a cache duration from 10 minutes to 6 days.</p> <p>Use a shorter TTL when your source content changes frequently and freshness is more important. Use a longer TTL when your content is stable and you want more cache reuse.</p> <p>For example, set <code>cache_ttl</code> to <code>518400</code> to retain cached responses for 6 days:</p> <figure class="nb-code-figure" data-nb-lang="json"><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="json" data-nb-lang="json"><code><span class="line"><span class="nb-shiki-140thh">{</span></span> <span class="line"><span class="nb-shiki-dzsirb"> "cache_ttl"</span><span class="nb-shiki-140thh">: </span><span class="nb-shiki-dzsirb">518400</span></span> <span class="line"><span class="nb-shiki-140thh">}</span></span></code></pre></figure> <div tabindex="-1" class="heading-wrapper level-h4"><h4 id="purge-cached-responses">Purge cached responses</h4><a class="anchor-link" href="#purge-cached-responses"><span aria-hidden="true" class="anchor-icon"><svg width="16" height="16" viewBox="0 0 24 24"><path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path></svg></span></a></div> <p>You can also purge all cached responses for an instance on demand. Purging cached responses does not delete indexed content or source files.</p> <p>It prevents AI Search from reusing previous cached responses, so subsequent similar queries generate fresh answers and repopulate the cache.</p> <figure class="nb-code-figure" data-nb-lang="bash"><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="bash" data-nb-lang="bash"><code><span class="line"><span class="nb-shiki-1t8gfj">curl</span><span class="nb-shiki-dzsirb"> -X</span><span class="nb-shiki-mdbnqw"> POST</span><span class="nb-shiki-mdbnqw"> "https://api.cloudflare.com/client/v4/accounts/</span><span class="nb-shiki-140thh">$ACCOUNT_ID</span><span class="nb-shiki-mdbnqw">/ai-search/instances/</span><span class="nb-shiki-140thh">$INSTANCE_NAME</span><span class="nb-shiki-mdbnqw">/purge_cache"</span><span class="nb-shiki-dzsirb"> \</span></span> <span class="line"><span class="nb-shiki-dzsirb"> -H</span><span class="nb-shiki-mdbnqw"> "Authorization: Bearer </span><span class="nb-shiki-140thh">$CLOUDFLARE_API_TOKEN</span><span class="nb-shiki-mdbnqw">"</span></span></code></pre></figure> <p>You can also purge cached responses from the instance settings page in the Cloudflare dashboard.</p> <p>Refer to <a href="https://developers.cloudflare.com/ai-search/configuration/retrieval/cache/">similarity cache</a> for the full list of supported <code>cache_ttl</code> values and more details about cache behavior.</p>
The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.