From ce92b48d1f73b73ae826be72c492be706956ad35 Mon Sep 17 00:00:00 2001 From: Logan McAnsh Date: Fri, 14 May 2021 12:41:11 -0400 Subject: [PATCH] feat: add caching Signed-off-by: Logan McAnsh --- app/routes/index.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/routes/index.tsx b/app/routes/index.tsx index ac9a1004..97e6ec18 100644 --- a/app/routes/index.tsx +++ b/app/routes/index.tsx @@ -1,4 +1,9 @@ -import type { MetaFunction, LinksFunction, RouteComponent } from 'remix'; +import type { + MetaFunction, + LinksFunction, + RouteComponent, + HeadersFunction, +} from 'remix'; import { block } from 'remix'; import { FunHoverLink } from '../components/fun-hover-link'; @@ -8,6 +13,11 @@ const meta: MetaFunction = () => ({ description: 'personal website for logan mcansh', }); +const headers: HeadersFunction = () => ({ + 'Cache-Control': + 'public, max-age=3600, s-maxage=3600, stale-while-revalidate=3600', +}); + const links: LinksFunction = () => [ block({ rel: 'preload', @@ -56,4 +66,4 @@ const IndexPage: RouteComponent = () => ( ); export default IndexPage; -export { meta, links }; +export { headers, meta, links };