summary refs log tree commit diff
path: root/src/cdn/util/cache.ts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-25 05:31:32 +0100
committerRory& <root@rory.gay>2025-12-25 07:11:26 +0100
commit19edf63e37e84f81e7168e7411285084a30002ba (patch)
treec924a7da07b3cdcfb5ac0a70932cd241c6a18e96 /src/cdn/util/cache.ts
parentWIP nix stuff (diff)
downloadserver-ts-github/dev/emma-fuck-this.tar.xz
various crap i was working on github/dev/emma-fuck-this dev/emma-fuck-this
Diffstat (limited to 'src/cdn/util/cache.ts')
-rw-r--r--src/cdn/util/cache.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cdn/util/cache.ts b/src/cdn/util/cache.ts
new file mode 100644

index 00000000..c48087dd --- /dev/null +++ b/src/cdn/util/cache.ts
@@ -0,0 +1,7 @@ +import { NextFunction, Response, Request } from "express"; + +export function cache(req: Request, res: Response, next: NextFunction) { + const durationInSeconds = 21600; // 6 hours + res.set("Cache-Control", `public, max-age=${durationInSeconds}, s-maxage=${durationInSeconds}, immutable`); + next(); +}