deno.land / x / lume@v2.1.4 / middlewares / no_cache.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import type { Middleware } from "../core/server.ts";
/** Add a header to prevent the browser cache */export default function noCache(): Middleware { return async (request, next) => { const response = await next(request); const { headers } = response; headers.set("cache-control", "no-cache no-store must-revalidate"); headers.delete("last-modified"); headers.delete("etag");
return response; };}
lume

Version Info

Tagged at
7 months ago