diff --git a/middlewares/utils.ts b/middlewares/utils.ts index 9c9ce60d9..47cb5873d 100644 --- a/middlewares/utils.ts +++ b/middlewares/utils.ts @@ -63,7 +63,12 @@ export const fetchAndCacheEntry = async (path: string, lang?: Lang) => { } const { contentType, uid } = await resolveEntry(path, lang) - const expiresAt = Date.now() / 1000 + 3600 + let expiresAt = Date.now() / 1000 + if (!contentType || !uid) { + expiresAt += 600 + } else { + expiresAt += 3600 * 12 + } const entryCache = { contentType, uid, expiresAt } size += JSON.stringify(entryCache).length console.log("[CMS MIDDLEWARE] Adding to cache", entryCache)