Skip to content

Commit 847fe95

Browse files
committed
Set AIA proxy cache to immutable with 1-year max-age
AIA certificates at a given URL never change — a CA will not serve different DER bytes at the same endpoint. Use max-age=31536000 with immutable directive to cache permanently at both Cloudflare edge and browser level.
1 parent 0dbfb9a commit 847fe95

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

web/functions/api/fetch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ export const onRequestGet: PagesFunction = async ({ request }) => {
196196
responseHeaders.set("Content-Type", "application/octet-stream");
197197
responseHeaders.set("Content-Length", body.byteLength.toString());
198198
responseHeaders.set("X-Content-Type-Options", "nosniff");
199-
// Cache certificate responses for 1 hour — they rarely change
200-
responseHeaders.set("Cache-Control", "public, max-age=3600");
199+
// Cache forever — AIA certificates are immutable (same URL = same cert)
200+
responseHeaders.set("Cache-Control", "public, max-age=31536000, immutable");
201201

202202
return new Response(body, { status: 200, headers: responseHeaders });
203203
} catch {

0 commit comments

Comments
 (0)