perf(imageproxy): do not set cookies to image proxy so CDNs can cache images (#3332)

CDNs such as Cloudflare bypass their cache if cookies are set in the response.
clearCookies
middleware removes the header before imageproxy serves the image.
This commit is contained in:
Pedro Nascimento
2023-02-12 08:05:29 -03:00
committed by GitHub
parent 33e7691b94
commit 966639df43
2 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
const clearCookies: Middleware = (_req, res, next) => {
res.removeHeader('Set-Cookie');
next();
};
export default clearCookies;