14 lines
394 B
TypeScript
14 lines
394 B
TypeScript
import "server-only";
|
|
|
|
import { cacheLife, cacheTag } from "next/cache";
|
|
|
|
import { getPublicAnalytics } from "@/lib/analytics/queries";
|
|
import { ANALYTICS_CACHE_TAG } from "@/lib/cache/tags";
|
|
|
|
export async function getCachedPublicAnalytics() {
|
|
"use cache: remote";
|
|
cacheTag(ANALYTICS_CACHE_TAG);
|
|
cacheLife({ stale: 15, revalidate: 60, expire: 60 * 60 });
|
|
return getPublicAnalytics();
|
|
}
|