dumb cache control test?!?!?!

This commit is contained in:
skidoodle 2023-12-14 08:10:08 +01:00
parent b612d2327d
commit 587b15c128
3 changed files with 3 additions and 0 deletions

View file

@ -85,5 +85,6 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
break
}
res.setHeader('Cache-Control', 's-maxage=31536000')
res.status(200).json({ flPdfUrl, utPdfUrl, flZipUrl, utZipUrl })
}

View file

@ -20,6 +20,7 @@ export default async function handler(
}
try {
res.setHeader('Cache-Control', 's-maxage=31536000')
const response = await fetch(link, { method: 'GET' })
const contentType = response.headers.get('content-type')
if (contentType == 'application/pdf') {

View file

@ -15,6 +15,7 @@ export default async function handler(
}
try {
res.setHeader('Cache-Control', 's-maxage=31536000')
const { protocol, host } = new URL(link)
if (protocol && host) {
const response = await fetch(link, { method: 'HEAD' })