started · updated
Next.js introduces explicit caching and partial prefetching features
Next.js 16 is transitioning from implicit caching to an explicit model using the ‘use cache’ directive. This change aims to resolve unpredictable behavior where developers could not easily determine when route segments became static or dynamic. Under the new system, developers can mark specific functions or components for caching, set expiration times using ‘cacheLife()’, and manage invalidation via ‘cacheTag()’.
Additionally, Next.js 16.3 introduces partial prefetching as an opt-in feature to address navigation delays in the App Router. Previously, prefetching often stopped at the first Suspense boundary, leading to sluggish transitions. The new functionality, combined with new cache component primitives, allows the framework to extract loading shells from routes, enabling the client to render instant transitions while the server streams dynamic content.