From a839f8f9983423906a00663612a4a6716900f925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Sun, 28 Jul 2024 21:31:07 +0200 Subject: [PATCH] Move setting Cache-Control to try block --- src/pages/index.astro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index e529d3d..d658337 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -24,12 +24,12 @@ try { if (noEmptyParams && paramsNotEqual) graphProps = await getShortestPaths(source, dest); + + // Cache the page for 2 weeks + Astro.response.headers.set('Cache-Control', 'public, max-age=1209600'); } catch (error) { return Astro.redirect('/error'); } - -// Cache the page for 2 weeks -Astro.response.headers.set('Cache-Control', 'public, max-age=1209600'); ---