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
@@ -7,7 +7,11 @@ import {
} from "@/lib/graphql/Query/ContentPage/ContentPage.graphql"
import { notFound } from "@/server/errors/trpc"
import { generateTag, generateTagsFromSystem } from "@/utils/generateTag"
import {
generateRefsResponseTag,
generateTag,
generateTagsFromSystem,
} from "@/utils/generateTag"
import { contentPageRefsSchema } from "./output"
@@ -50,7 +54,7 @@ export async function fetchContentPageRefs(lang: Lang, uid: string) {
document: GetContentPageRefs,
variables: { locale: lang, uid },
cacheOptions: {
key: generateTag(lang, uid),
key: generateRefsResponseTag(lang, uid),
ttl: "max",
},
},