Merged in fix/SW-2945-cache-timings-for-resolve-entry (pull request #2264)
Fix/SW-2945 cache timings for resolve entry * fix: cache resolveentry() harder and revalidate on publish instead * logging: use debug logging for requests and add logging when tll is invalid Approved-by: Linus Flood
This commit is contained in:
@@ -10,18 +10,14 @@ export const fetchAndCacheEntry = async (path: string, lang: Lang) => {
|
||||
|
||||
return cache.cacheOrGet(
|
||||
cacheKey,
|
||||
async (overrideTTL) => {
|
||||
async () => {
|
||||
const { contentType, uid } = await resolveEntry(path, lang)
|
||||
|
||||
if (!contentType || !uid) {
|
||||
overrideTTL?.("10m")
|
||||
}
|
||||
|
||||
return {
|
||||
contentType,
|
||||
uid,
|
||||
}
|
||||
},
|
||||
"1d"
|
||||
"max"
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user