Set s-maxage header (#74)
This should fix caching per the docs https://zeit.co/docs/v2/routing/caching
This commit is contained in:
parent
b5f0fc0cd8
commit
4648a07531
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue