diff --git a/src/middleware.ts b/src/middleware.ts index 3f1b7e9..0a68192 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -8,6 +8,8 @@ export const cors = (_: Request, res: Response, next: NextFunction) => { res .setHeader("Access-Control-Allow-Origin", host) .setHeader("Access-Control-Allow-Methods", "GET, POST") + // Clients should cache CORS policy for 1 day + .setHeader("Access-Control-Max-Age", 86400) .setHeader( "Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"