Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cache-control #6

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pages/_sites/sapin/index.tsx
Expand Up @@ -35,7 +35,7 @@ export default function Home({ site, color, products }: Props) {
)
}

export async function getServerSideProps({ req }: { req: NextApiRequest }) {
export async function getServerSideProps({ req, res }: { req: NextApiRequest }) {
const site = 'sapin';
let products = [];
try {
Expand All @@ -62,7 +62,7 @@ export async function getServerSideProps({ req }: { req: NextApiRequest }) {
}
products = [e.status];
}

res.setHeader('Cache-Control', 'max-age=900');
Copy link
Owner Author

Choose a reason for hiding this comment

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


return {
props: {
Expand Down