mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2025-02-15 05:39:15 +01:00
dumb cache control test?!?!?!
This commit is contained in:
parent
b612d2327d
commit
587b15c128
3 changed files with 3 additions and 0 deletions
|
@ -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 })
|
||||
}
|
||||
|
|
|
@ -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') {
|
||||
|
|
|
@ -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' })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue