Missing Revalidation

Server actions with DB mutations but no revalidatePath

infoReliabilitymissing-revalidation

Why this matters

After a server action mutates data, the page still shows stale cached content unless you call revalidatePath or revalidateTag. Users think their action didn't work.

Bad
"use server";

export async function updateTitle(id: string, title: string) {
  await db.post.update({
    where: { id },
    data: { title },
  });
  // Page still shows the old title!
}
Good
"use server";

import { revalidatePath } from "next/cache";

export async function updateTitle(id: string, title: string) {
  await db.post.update({
    where: { id },
    data: { title },
  });
  revalidatePath("/posts");
}

How to fix

Call revalidatePath() or revalidateTag() after every server action that writes to the database, so cached pages show fresh data.

All rules