Next.js Caching Previous Model and Migration
Installation
SKILL.md
Next.js Caching Previous Model and Migration
Expert guidance on caching and revalidating data without Cache Components — fetch options, unstable_cache, route segment configs, and on-demand revalidation.
@doc-version: 16.2.6
Core Concepts
สำหรับโปรเจกต์ที่ ไม่ได้เปิด cacheComponents: true — ใช้โมเดลเดิม:
fetch+cacheoptionunstable_cacheสำหรับ non-fetch functions- Route segment configs (
dynamic,revalidate,fetchCache) - On-demand revalidation (
revalidateTag,revalidatePath)
Guidelines
1. Caching fetch Requests
โดย default fetch ไม่ถูก cache — ต้อง opt-in: