Set s-maxage header (#74)

This should fix caching per the docs https://zeit.co/docs/v2/routing/caching
This commit is contained in:
Steven 2019-04-20 21:36:50 -04:00 committed by GitHub
parent b5f0fc0cd8
commit 4648a07531
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ export default async function handler(req: IncomingMessage, res: ServerResponse)
const file = await getScreenshot(fileUrl, fileType, isDev);
res.statusCode = 200;
res.setHeader('Content-Type', `image/${fileType}`);
res.setHeader('Cache-Control', `public, immutable, no-transform, max-age=31536000`);
res.setHeader('Cache-Control', `public, immutable, no-transform, s-maxage=31536000, max-age=31536000`);
res.end(file);
} catch (e) {
res.statusCode = 500;