From 4d403aa08679fedb041693b462e1db1c935a02ce Mon Sep 17 00:00:00 2001 From: igoramf Date: Tue, 7 Apr 2026 15:13:59 -0300 Subject: [PATCH] =?UTF-8?q?Remove=20DECO=5FPAGE=5FCACHE=5FENABLED=20env=20?= =?UTF-8?q?var=20=E2=80=94=20enable=20page=20cache=20by=20default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/middleware.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/middleware.ts b/runtime/middleware.ts index 9c2112301..9afbc06da 100644 --- a/runtime/middleware.ts +++ b/runtime/middleware.ts @@ -106,7 +106,6 @@ async (ctx, next) => { const DEBUG_COOKIE = "deco_debug"; const DEBUG_ENABLED = "enabled"; -const PAGE_CACHE_ENABLED = Deno.env.get("DECO_PAGE_CACHE_ENABLED") === "true"; const PAGE_CACHE_CONTROL = Deno.env.get("DECO_PAGE_CACHE_CONTROL") ?? "public, max-age=90, s-maxage=90, stale-while-revalidate=30"; @@ -437,7 +436,7 @@ export const middlewareFor = ( if (hasSetCookie) { // Set-cookie present: never cache (same behavior as main) newHeaders.set("Cache-Control", "no-store, no-cache, must-revalidate"); - } else if (isHtmlResponse && PAGE_CACHE_ENABLED && !isPageDirty) { + } else if (isHtmlResponse && !isPageDirty) { const flags = ctx.var?.flags ?? []; const allFlagsCacheable = flags.length > 0 ? flags.every((flag) => flag.cacheable === true)