Skip to content

Commit

Permalink
feat: add caching
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <logan@mcan.sh>
  • Loading branch information
mcansh committed May 14, 2021
1 parent 363b1ad commit ce92b48
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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',
Expand Down Expand Up @@ -56,4 +66,4 @@ const IndexPage: RouteComponent = () => (
);

export default IndexPage;
export { meta, links };
export { headers, meta, links };

1 comment on commit ce92b48

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for mcan.sh ready!

✅ Preview
https://mcansh-29ww5js18-mcansh.vercel.app

Built with commit ce92b48.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.