From 15931b9e9977128719fe1f2f9096a156bd4bb2ea Mon Sep 17 00:00:00 2001 From: Tom Beckenham <34339192+tombeckenham@users.noreply.github.com> Date: Tue, 18 Aug 2026 17:18:38 +1000 Subject: [PATCH] perf(docs): keep latest HTML at the Cloudflare edge for 1 hour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Latest docs currently expire at the edge after 60s, so many navigations pay a 1–2s origin SSR. Lengthen CDN TTL and rely on the existing GitHub webhook Cache-Tag purge for freshness. --- src/utils/docs-cache-headers.ts | 2 +- src/utils/docs.functions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/docs-cache-headers.ts b/src/utils/docs-cache-headers.ts index e095f4147..e684afdca 100644 --- a/src/utils/docs-cache-headers.ts +++ b/src/utils/docs-cache-headers.ts @@ -2,7 +2,7 @@ import { findLibrary, getBranch } from '~/libraries' import { docsContentNegotiationVaryHeader } from './http' const latestDocsCdnCacheControl = - 'public, max-age=60, stale-while-revalidate=60' + 'public, max-age=3600, stale-while-revalidate=86400' const versionedDocsCdnCacheControl = 'public, max-age=300, stale-while-revalidate=300' diff --git a/src/utils/docs.functions.ts b/src/utils/docs.functions.ts index 73f34fdeb..77b85a33d 100644 --- a/src/utils/docs.functions.ts +++ b/src/utils/docs.functions.ts @@ -435,7 +435,7 @@ export const fetchDocs = createServerFn({ method: 'GET' }) frontMatter.userDescription ?? removeMarkdown(frontMatter.excerpt ?? '') const keywords = extractFrontMatterKeywords(frontMatter.data.keywords) - setDocsCacheHeaders('public, max-age=60, stale-while-revalidate=60') + setDocsCacheHeaders('public, max-age=3600, stale-while-revalidate=86400') return { content: frontMatter.content,