From e6ac2d865125b6e901b7658df4e31b3dadd4b5e0 Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Sun, 28 Jul 2024 17:10:48 +0200 Subject: [PATCH] Disable page caching on scan and gallery pages --- package.json | 2 +- src/cache/pageCache.ts | 8 ++++---- .../[locale]/collectibles/[slug]/gallery/[index].astro | 2 ++ .../[locale]/collectibles/[slug]/scans/[index].astro | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cde5680..1bacd97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "v3.accords-library.com", - "version": "3.0.0-beta.8", + "version": "3.0.0-beta.9", "scripts": { "dev": "astro dev", "start": "astro dev", diff --git a/src/cache/pageCache.ts b/src/cache/pageCache.ts index cb63ef4..6756d75 100644 --- a/src/cache/pageCache.ts +++ b/src/cache/pageCache.ts @@ -200,14 +200,14 @@ export class PageCache { case SDKEndpointNames.getCollectibleGallery: return [`/collectibles/${change.slug}/gallery`]; - case SDKEndpointNames.getCollectibleGalleryImage: - return [`/collectibles/${change.slug}/gallery/${change.index}`]; + // case SDKEndpointNames.getCollectibleGalleryImage: + // return [`/collectibles/${change.slug}/gallery/${change.index}`]; case SDKEndpointNames.getCollectibleScans: return [`/collectibles/${change.slug}/scans`]; - case SDKEndpointNames.getCollectibleScanPage: - return [`/collectibles/${change.slug}/scans/${change.index}`]; + // case SDKEndpointNames.getCollectibleScanPage: + // return [`/collectibles/${change.slug}/scans/${change.index}`]; case SDKEndpointNames.getPage: return [`/pages/${change.slug}`]; diff --git a/src/pages/[locale]/collectibles/[slug]/gallery/[index].astro b/src/pages/[locale]/collectibles/[slug]/gallery/[index].astro index 7e08c24..600f8f8 100644 --- a/src/pages/[locale]/collectibles/[slug]/gallery/[index].astro +++ b/src/pages/[locale]/collectibles/[slug]/gallery/[index].astro @@ -7,6 +7,8 @@ import { formatInlineTitle, formatRichTextToString } from "src/utils/format"; import { fetchOr404 } from "src/utils/responses"; import { getFileIcon } from "src/utils/attributes"; +Astro.locals.pageCaching = false; + const slug = Astro.params.slug!; const index = Astro.params.index!; const { getLocalizedUrl, getLocalizedMatch, t, formatDate } = await getI18n( diff --git a/src/pages/[locale]/collectibles/[slug]/scans/[index].astro b/src/pages/[locale]/collectibles/[slug]/scans/[index].astro index 0b3ed60..2feca86 100644 --- a/src/pages/[locale]/collectibles/[slug]/scans/[index].astro +++ b/src/pages/[locale]/collectibles/[slug]/scans/[index].astro @@ -6,6 +6,8 @@ import { payload } from "src/services"; import { formatInlineTitle, formatRichTextToString } from "src/utils/format"; import { fetchOr404 } from "src/utils/responses"; +Astro.locals.pageCaching = false; + const slug = Astro.params.slug!; const index = Astro.params.index!; const { formatScanIndexShort, getLocalizedMatch, getLocalizedUrl } = await getI18n(