Skip to content

Commit

Permalink
No cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksongoode committed Aug 30, 2024
1 parent 8c12a97 commit 1950d74
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pages/api/recent-posts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ export default async function (req: NextApiRequest, res: NextApiResponse) {
// Sort posts from newest to oldest.
data.posts.sort((a, b) => b.published - a.published).slice(0, limit)

res.setHeader(
'Cache-Control',
`s-maxage=${ttl}, stale-while-revalidate=${ttl}`
)
// res.setHeader(
// 'Cache-Control',
// `s-maxage=${ttl}, stale-while-revalidate=${ttl}`
// )
res.setHeader('Cache-Control', 'no-store, max-age=0')

res.status(200).json(data)
}

0 comments on commit 1950d74

Please sign in to comment.