Skip to content

Commit ccf5895

Browse files
committed
add deco render cache control via env vars
1 parent 33580b9 commit ccf5895

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

runtime/routes/render.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ const fromRequest = (req: Request): Options => {
7070
};
7171
};
7272

73+
const DECO_RENDER_CACHE_CONTROL = Deno.env.get("DECO_RENDER_CACHE_CONTROL") || "public, max-age=60, must-revalidate, s-maxage=60, stale-while-revalidate=3600, stale-if-error=86400";
74+
7375
export const handler = createHandler(async (
7476
ctx,
7577
) => {
@@ -103,7 +105,7 @@ export const handler = createHandler(async (
103105
// We can test if caching on the browser helps too.
104106
response.headers.set(
105107
"cache-control",
106-
"public, max-age=60, must-revalidate, s-maxage=60, stale-while-revalidate=3600, stale-if-error=86400",
108+
DECO_RENDER_CACHE_CONTROL,
107109
);
108110
} else {
109111
response.headers.set(

0 commit comments

Comments
 (0)