feat : buzz feedback
This commit is contained in:
Vendored
+47
@@ -3,6 +3,13 @@ import "server-only";
|
||||
import { cacheLife, cacheTag } from "next/cache";
|
||||
|
||||
import { getPublicPage, listPublicCharacters } from "@/lib/content/queries";
|
||||
import {
|
||||
getPublicArtifactExport,
|
||||
getPublicGuide,
|
||||
getPublicTeamExport,
|
||||
getPublicWeaponExport,
|
||||
listGuideCards,
|
||||
} from "@/lib/guides/queries";
|
||||
import {
|
||||
characterCacheTag,
|
||||
dataSourceCacheTag,
|
||||
@@ -40,3 +47,43 @@ export async function getCachedPublicPage(
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function getCachedPublicGuideCards() {
|
||||
"use cache: remote";
|
||||
cacheLife({ stale: 30, revalidate: 60, expire: 60 * 60 });
|
||||
cacheTag(DIRECTORY_CACHE_TAG);
|
||||
return listGuideCards();
|
||||
}
|
||||
|
||||
export async function getCachedPublicGuide(slug: string) {
|
||||
"use cache: remote";
|
||||
cacheLife({ stale: 15, revalidate: 60, expire: 60 * 60 });
|
||||
const result = await getPublicGuide(slug);
|
||||
cacheTag(DIRECTORY_CACHE_TAG);
|
||||
if (result) cacheTag(pageCacheTag(result.id));
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function getCachedPublicTeamExport(teamId: string) {
|
||||
"use cache: remote";
|
||||
cacheLife({ stale: 15, revalidate: 60, expire: 60 * 60 });
|
||||
const result = await getPublicTeamExport(teamId);
|
||||
if (result) cacheTag(pageCacheTag(result.guideId));
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function getCachedPublicWeaponExport(guideId: string) {
|
||||
"use cache: remote";
|
||||
cacheLife({ stale: 15, revalidate: 60, expire: 60 * 60 });
|
||||
const result = await getPublicWeaponExport(guideId);
|
||||
cacheTag(pageCacheTag(guideId));
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function getCachedPublicArtifactExport(guideId: string) {
|
||||
"use cache: remote";
|
||||
cacheLife({ stale: 15, revalidate: 60, expire: 60 * 60 });
|
||||
const result = await getPublicArtifactExport(guideId);
|
||||
cacheTag(pageCacheTag(guideId));
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user