Files
gunshiz 9580407a90
CI / Verify (push) Successful in 1m56s
CI / Build immutable images and deploy (push) Successful in 3m12s
perf : cache
2026-10-08 23:21:34 +07:00

21 lines
642 B
TypeScript

import "server-only";
import { cacheLife, cacheTag } from "next/cache";
import { getActiveCatalog, getCatalogOptions } from "@/lib/guides/queries";
import { CATALOG_CACHE_TAG, GLOSSARY_CACHE_TAG } from "./tags";
export async function getCachedCatalogOptions() {
"use cache: remote";
cacheLife({ stale: 0, revalidate: 300, expire: 3600 });
cacheTag(CATALOG_CACHE_TAG, GLOSSARY_CACHE_TAG);
return getCatalogOptions();
}
export async function getCachedActiveCatalog() {
"use cache: remote";
cacheLife({ stale: 0, revalidate: 300, expire: 3600 });
cacheTag(CATALOG_CACHE_TAG, GLOSSARY_CACHE_TAG);
return getActiveCatalog();
}