forked from ppfun/pixelplanet
send cache-control also on 503 for reasons
This commit is contained in:
parent
855a5b426b
commit
d75e65efec
|
@ -45,10 +45,13 @@ export default async (req: Request, res: Response, next) => {
|
|||
let curEtag = chunkEtags.get(etagKey);
|
||||
const preEtag = req.headers['if-none-match'];
|
||||
|
||||
res.set({
|
||||
'Cache-Control': `public, s-maxage=${60}, max-age=${40}`, // seconds
|
||||
});
|
||||
|
||||
if (curEtag && preEtag && preEtag === curEtag) {
|
||||
res.set({
|
||||
ETag: curEtag,
|
||||
'Cache-Control': `public, s-maxage=${60}, max-age=${40}`, // seconds
|
||||
});
|
||||
res.status(304).end();
|
||||
return;
|
||||
|
@ -68,10 +71,6 @@ export default async (req: Request, res: Response, next) => {
|
|||
return;
|
||||
}
|
||||
|
||||
res.set({
|
||||
'Cache-Control': `public, s-maxage=${60}, max-age=${40}`, // seconds
|
||||
});
|
||||
|
||||
if (!chunk) {
|
||||
res.set({
|
||||
'Content-Type': 'application/octet-stream',
|
||||
|
|
Loading…
Reference in New Issue
Block a user