improve(api): add cache headers for favicons

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-11-24 21:55:34 +01:00
parent 222b54b907
commit de5205040b

View File

@@ -57,6 +57,8 @@ export async function getFavicon(
if (cacheKey) {
getRedisCache().set(`favicon:${cacheKey}`, buffer.toString('base64'));
}
reply.header('Cache-Control', 'public, max-age=604800');
reply.header('Expires', new Date(Date.now() + 604800000).toUTCString());
reply.type('image/png');
return reply.send(buffer);
}