On-demand revalidation cho phép invalidate cache và regenerate pages ngay lập tức thay vì đợi timeout.
- Pages Router:
res.revalidate('/path')trong API route. - App Router:
revalidatePath('/path')hoặcrevalidateTag('posts')trong Server Action hoặc Route Handler.
Phù hợp khi CMS webhook trigger cần update content ngay.