mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
22 lines
572 B
TypeScript
22 lines
572 B
TypeScript
import { NextResponse } from "next/server";
|
|
|
|
export function proxy() {
|
|
const response = NextResponse.next();
|
|
response.headers.set("X-Cacheability-Middleware", "matched");
|
|
return response;
|
|
}
|
|
|
|
export const config = {
|
|
matcher: [
|
|
"/cacheability/middleware",
|
|
{
|
|
source: "/cacheability/conditional-middleware-cookie",
|
|
has: [{ type: "cookie", key: "cacheability-middleware" }],
|
|
},
|
|
{
|
|
source: "/cacheability/conditional-middleware-header",
|
|
has: [{ type: "header", key: "x-cacheability-middleware", value: "enabled" }],
|
|
},
|
|
],
|
|
};
|