fix: proper cache keys for refs

This commit is contained in:
Michael Zetterberg
2025-03-24 16:32:43 +01:00
parent 0e2192be0f
commit d236a6e8fd
8 changed files with 37 additions and 16 deletions

View File

@@ -5,7 +5,11 @@ import { request } from "@/lib/graphql/request"
import { notFound } from "@/server/errors/trpc"
import { getCacheClient } from "@/services/dataCache"
import { generateTag, generateTagsFromSystem } from "@/utils/generateTag"
import {
generateRefsResponseTag,
generateTag,
generateTagsFromSystem,
} from "@/utils/generateTag"
import { collectionPageRefsSchema } from "./output"
@@ -44,7 +48,7 @@ export async function fetchCollectionPageRefs(lang: Lang, uid: string) {
)
const cacheClient = await getCacheClient()
const cacheKey = generateTag(lang, uid)
const cacheKey = generateRefsResponseTag(lang, uid)
const refsResponse = await cacheClient.cacheOrGet(
cacheKey,
async () =>