Read-your-writes
revalidateTag is deliberately eventual: it serves stale content first. Sometimes
that is wrong. When a user saves a profile and you send them straight back to the
page, they expect to see their own change immediately. updateTag gives that
read-your-writes guarantee.
It is a new Server Actions-only API in Next.js 16. It expires the tagged cache and reads fresh data within the same request:
'use server';
import { updateTag } from 'next/cache';
export async function updateUserProfile(userId: string, profile: Profile) {
await db.users.update(userId, profile);
updateTag(`user-${userId}`);
}
The difference from revalidateTag is timing. updateTag invalidates immediately,
so the user sees the change right away; revalidateTag with a profile serves
stale content and refreshes in the background. Because it is scoped to Server
Actions, updateTag also refreshes the calling route and invalidates the matching
client cache entries, so the whole round-trip stays consistent. Reach for it in
forms, user settings, and any workflow where a stale read would be confusing.
You are about to answer a short quiz on updateTag.