Menu

1 / 3

Start Learning From the Docs. Then Find Your Own Way.

DEV Community: nextjs·Mohsen Fallahnejad·4 days ago
#f7fi3cUV
#devtonextjs#devto#dev#docs#version
Reading 0:00
15s threshold

// 31 October: I added this to my blog's homepage export const revalidate = 600 ;

// 1 November: I deleted it and wrote this instead " use cache " ; cacheLife ( " hours " );

Enter fullscreen mode

Exit fullscreen mode

That's real, and it's in this blog's git history. On 31 October, I added revalidate to pages across the site. The next day, I turned on Next.js Cache Components and removed every one of them.

revalidate wasn't a bad line. It's a normal way to cache a Next.js page, and countless tutorials teach it. But the docs for the version I run say this about the switch I made:

After enabling the flag, route segments that still export dynamic , revalidate , or fetchCache will error.

So the same line can be correct in one project and an error in another, depending on the version and the setup. A tutorial can't know which one you have.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.