Skip to content

Commit

Permalink
cache-control
Browse files Browse the repository at this point in the history
  • Loading branch information
wslyvh committed Jun 18, 2024
1 parent 23ca15b commit 9a1ec45
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/frontend/src/pages/api/frames/images/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
? 100
: ((totalNrOfParticipants - numberOfWinners) / totalNrOfParticipants) * 100

res.setHeader('Cache-Control', 'no-store, no-cache, max-age=1, must-revalidate')

// Withdrawal period ended
if (moment().isAfter(withdraw)) {
return new ImageResponse(
Expand All @@ -40,7 +42,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
width: 1146,
height: 600,
headers: {
'Cache-Control': 'public, max-age=0',
'Cache-Control': 'max-age=60',
},
},
)
Expand Down Expand Up @@ -79,7 +81,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
width: 1146,
height: 600,
headers: {
'Cache-Control': 'public, max-age=0',
'Cache-Control': 'max-age=60',
},
},
)
Expand Down Expand Up @@ -128,7 +130,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
width: 1146,
height: 600,
headers: {
'Cache-Control': 'public, max-age=0',
'Cache-Control': 'max-age=60',
},
},
)
Expand Down

0 comments on commit 9a1ec45

Please sign in to comment.