Blog. waqas

this is a test post

this is a test post

waqas ishaque
Waqas Ishaque
1 min read

New Features and Improvements

Cache Components

Cache Components are a new set of features designed to make caching in Next.js both more explicit, and more flexible. They center around the new "use cache" directive, which can be used to cache pages, components, and functions, and which leverages the compiler to automatically generate cache keys wherever it’s used. #new

Unlike the implicit caching found in previous versions of the App Router, caching with Cache Components is entirely opt-in. All dynamic code in any page, layout, or API route is executed at request time by default, giving Next.js an out-of-the-box experience that’s better aligned with what developers expect from a full-stack application framework.

Cache Components also complete the story of Partial Prerendering (PPR), which was first introduced in 2023. Prior to PPR, Next.js had to choose whether to render each URL statically or dynamically; there was no middle ground. PPR eliminated this dichotomy, and let developers opt portions of their static pages into dynamic rendering (via Suspense) without sacrificing the fast initial load of fully static pages.

You can enable Cache Components in your next.config.ts file:


More Stories

Third Post after deployment

Third Post after deployment

1 min read

Checking uploads from phone

waqas ishaque
Waqas Ishaque
this is second post

this is second post

1 min read

http://localhost:3000/_next/image?urlhttp://localhost:3000/_next/image?url=https0%26fit%3Dmax%26auto%3Dformat&w=3840&q=75

waqas ishaque
Waqas Ishaque