Next.js · Middle · Question 4 of 75
How does updateTag differ from revalidateTag in Next.js 16?
- ✓Correct answer:
updateTagexpires the cache immediately (read-your-writes),revalidateTagis stale-while-revalidate - 2
updateTagworks only in Route Handlers, whilerevalidateTagworks only in proxy - 3They're synonyms;
revalidateTagis deprecated in favor ofupdateTag
Explanation
updateTag is available only in Server Actions: the user who changed the data sees the changes immediately. revalidateTag(tag, 'max') marks data as stale: visitors see the old version while the new one is prepared in the background - good for blogs and catalogs. In Next.js 16, revalidateTag requires a second argument - a cacheLife profile.