diff --git a/src/pages/[locale]/api/pages/partial.astro b/src/pages/[locale]/api/pages/partial.astro index bf95243..45b33b5 100644 --- a/src/pages/[locale]/api/pages/partial.astro +++ b/src/pages/[locale]/api/pages/partial.astro @@ -13,7 +13,6 @@ import PageCredits from "./_components/PageCredits.astro"; import type { EndpointPage } from "src/shared/payload/endpoint-types"; export const partial = true; -Astro.locals.pageCaching = false; interface Props { lang?: string; @@ -21,6 +20,10 @@ interface Props { page?: EndpointPage; } +if (!Astro.props.page) { + Astro.locals.pageCaching = false; +} + const reqUrl = new URL(Astro.request.url); const lang = Astro.props.lang ?? reqUrl.searchParams.get("lang")!; const slug = Astro.props.slug ?? reqUrl.searchParams.get("slug")!; diff --git a/src/pages/[locale]/api/timeline/partial.astro b/src/pages/[locale]/api/timeline/partial.astro index bb347ff..bacfc14 100644 --- a/src/pages/[locale]/api/timeline/partial.astro +++ b/src/pages/[locale]/api/timeline/partial.astro @@ -10,7 +10,6 @@ import type { EndpointChronologyEvent } from "src/shared/payload/endpoint-types" import { payload } from "src/services"; export const partial = true; -Astro.locals.pageCaching = false; interface Props { lang?: string; @@ -19,6 +18,10 @@ interface Props { index?: number; } +if (!Astro.props.event) { + Astro.locals.pageCaching = false; +} + const reqUrl = new URL(Astro.request.url); const lang = Astro.props.lang ?? reqUrl.searchParams.get("lang")!; const id = Astro.props.id ?? reqUrl.searchParams.get("id")!;