Repository navigation
Replies: 1 comment 1 reply
|
Hi there! The helpers use Next.js's default cache profile: The 15 minutes is the revalidation interval, rather than a hard expiration, a subsequent request can serve the cached result while a background refresh runs. Tag-based invalidation can happen sooner. Calling import { cacheLife, cacheTag } from 'next/cache';
export async function getSitecorePage(params: GetSitecorePageParams) {
'use cache';
cacheLife('hours');
// existing fetch and cacheTag calls
}Choose the profile that fits your publishing policy; keep the existing tags for on-demand revalidation. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
Should the OSR template include calls to cacheLife in the cache helper methods (getSitecorePage, getSitecoreDictionary, ...)?
According to the NextJS documentation:
The default profile has a
revalidateof 15 minutes. So OSR will really only cache for that amount of time without this?Additional information
No response
All reactions