Call
revalidateTag("posts") in the actionCalling revalidateTag("posts") in the action is correct. It invalidates every cached fetch with that tag, on whichever route uses it. The tempting router.refresh() is wrong here. It is a method on the router object that the useRouter() hook returns, so it only works in client code, not inside a Server Action. It also does not clear the Data Cache. redirect navigates to another page but does not invalidate any cached data.