mirror of
https://github.com/khairul169/code-share.git
synced 2025-04-29 00:59:37 +07:00
13 lines
339 B
TypeScript
13 lines
339 B
TypeScript
import { NextFunction, Request, Response } from "express";
|
|
|
|
export const nocache = (_req: Request, res: Response, next: NextFunction) => {
|
|
res.setHeader("Surrogate-Control", "no-store");
|
|
res.setHeader(
|
|
"Cache-Control",
|
|
"no-store, no-cache, must-revalidate, proxy-revalidate"
|
|
);
|
|
res.setHeader("Expires", "0");
|
|
|
|
next();
|
|
};
|