Revalidate segment and tags
Unanswered
Bedlington Terrier posted this in #help-forum
Bedlington TerrierOP
I have getPage function in my server component which look like this:
I expect this fetch to be invalidated either automatically every minute or immediately after the first user visit following a call to /api/revalidate?tag=....
However, currently, it doesn’t respect the automatic segment invalidation (every minute) and only invalidates after a POST request to /api/revalidate.
export const revalidate = 60;
async function getPage({ creator, slug, vendor }: UrlParams) {
const res = await fetch(
`${apiUrl}/api/storefront/page/${vendor}/${creator}/${slug}/`,
{
next: { tags: [`${vendor}_${creator}_${slug}`] },
}
);
I expect this fetch to be invalidated either automatically every minute or immediately after the first user visit following a call to /api/revalidate?tag=....
However, currently, it doesn’t respect the automatic segment invalidation (every minute) and only invalidates after a POST request to /api/revalidate.