This commit is contained in:
Linus Flood
2024-10-14 10:36:13 +02:00
parent 697d571ab2
commit a8f7c62f59

View File

@@ -36,13 +36,14 @@ export function getDefaultRequestHeaders(request: NextRequest) {
return headers return headers
} }
type ContentStackResponse = { const entryResponseCache: Map<
contentType: string | null string,
uid: string | null {
expiresAt: number contentType: string | null
} uid: string | null
expiresAt: number
const entryResponseCache: Map<string, ContentStackResponse> = new Map() }
> = new Map()
let size: number = 0 let size: number = 0
export const fetchAndCacheEntry = async (path: string, lang?: Lang) => { export const fetchAndCacheEntry = async (path: string, lang?: Lang) => {