From cd40ede71342de2c4e36dfe3343e90f963e20c7e Mon Sep 17 00:00:00 2001 From: Face <69168154+face-hh@users.noreply.github.com> Date: Mon, 23 Jun 2025 20:21:56 +0300 Subject: [PATCH] invalidate cache to help with CF cache --- website/src/hooks.server.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/website/src/hooks.server.ts b/website/src/hooks.server.ts index abd3d72..26a51b1 100644 --- a/website/src/hooks.server.ts +++ b/website/src/hooks.server.ts @@ -172,6 +172,13 @@ export const handle: Handle = async ({ event, resolve }) => { event.locals.userSession = userData; + if (event.url.pathname.startsWith('/api/')) { + const response = await svelteKitHandler({ event, resolve, auth }); + response.headers.set('Cache-Control', 'no-store, no-cache, must-revalidate, private'); + + return response; + } + return svelteKitHandler({ event, resolve, auth }); };