mirror of
https://github.com/maciejpedzich/six-degs-of-f1.git
synced 2024-11-10 00:43:02 +01:00
Move setting Cache-Control to try block
This commit is contained in:
parent
cd9b4b2a8b
commit
a839f8f998
@ -24,12 +24,12 @@ try {
|
|||||||
|
|
||||||
if (noEmptyParams && paramsNotEqual)
|
if (noEmptyParams && paramsNotEqual)
|
||||||
graphProps = await getShortestPaths(source, dest);
|
graphProps = await getShortestPaths(source, dest);
|
||||||
|
|
||||||
|
// Cache the page for 2 weeks
|
||||||
|
Astro.response.headers.set('Cache-Control', 'public, max-age=1209600');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return Astro.redirect('/error');
|
return Astro.redirect('/error');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache the page for 2 weeks
|
|
||||||
Astro.response.headers.set('Cache-Control', 'public, max-age=1209600');
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<BaseLayout>
|
<BaseLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user