Archive

#caching

5 notes match these filters

  • Next.js in Practice · Part 0517 min read

    Cache Components - use cache, cacheLife and cacheTag

    How the Cache Components model works in Next.js 16, what the compiler turns a 'use cache' function into, how the cache key is built from the function id, arguments, closures and build id, how cacheLife and cacheTag set an entry's lifetime and tags, and how cache handlers, 'use cache: private' and 'use cache: remote' store the result.

  • Next.js in Practice · Part 0612 min read

    Revalidation - Tags, Paths and Refresh

    How cached data gets fresh again in Next.js 16, covering time-based revalidation with cacheLife, revalidateTag with a profile, updateTag for read-your-own-writes, revalidatePath and its implicit path tags, refresh, and how an invalidation travels from a Server Action through the cache handlers to the client router.

  • Next.js in Practice · Part 2617 min read

    TanStack Query - Server Prefetch and Hydration

    A complete, copy-pasteable TanStack Query v5 setup for the Next.js 16.4.3 App Router - per-request clients, server prefetch with streamed pending queries, HydrationBoundary, useSuspenseQuery, mutations that invalidate both caches, Cache Components, and the pitfalls.