Next.jsのCache
docs
4種類のcache ref
Request Memoization
1回のレンダリング内の同一URLへのfetchを1回のrequestに抑える
同じrequestが重複しなくて嬉しい
Next.js: Data Cache
serverから各種data sourceへのrequestをcacheする
data sourceへのrequestを減って嬉しい
revalidate/無効化などの設定が可能
部分的にISGみがある
複数デプロイにまたがるcache
Full Route Cache
server上でレンダリングした生成物(RSC PayeloadとHTML)をcacheする
ページの返却が速くなるので嬉しい
Static Routeのみが対象
SSGみがある
単一デプロイ内でのcache
Router Cache
client上でのページ内容のcache
訪問済みのページやprefetchされたページが速く表示されるので嬉しい
Static RouteもDynamic Routeも両方対応
https://gyazo.com/9a2b7b41552090b9d1db12f2a8651b06
Blog - Next.js 13.2 | Next.js
betaで入った
Vercel Cache API: A progressive cache, integrated with Next.js – Vercel
Vercel Cache API
https://zenn.dev/sumiren/articles/664c86a28ec573
https://zenn.dev/cybozu_frontend/articles/react-cache-and-nextjs
https://nextjs.org/docs/app/building-your-application/caching
4種類
https://zenn.dev/cybozu_frontend/articles/next-caching-dedupe
https://nextjs.org/docs/app/building-your-application/data-fetching/fetching-caching-and-revalidating