Add 4 hour cache

This commit is contained in:
goat 2021-05-26 00:06:24 +02:00
parent 4f599d4ff5
commit ae8f16e64a
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -14,7 +14,8 @@ app.get('/characters/id/:charaId', async (req, res) => {
res.writeHead(200, { res.writeHead(200, {
'Content-Type': 'image/png', 'Content-Type': 'image/png',
'Content-Length': png.length 'Content-Length': png.length,
'Cache-Control': 'public, max-age=14400'
}); });
res.end(png, 'binary'); res.end(png, 'binary');
}catch(error){ }catch(error){
@ -37,7 +38,8 @@ app.get('/characters/name/:world/:charName', async (req, res) => {
res.writeHead(200, { res.writeHead(200, {
'Content-Type': 'image/png', 'Content-Type': 'image/png',
'Content-Length': png.length 'Content-Length': png.length,
'Cache-Control': 'public, max-age=14400'
}); });
res.end(png, 'binary'); res.end(png, 'binary');
}catch(error){ }catch(error){