Skip to content

Commit 3caf9aa

Browse files
committed
go back to revalidateTag
1 parent 5346af2 commit 3caf9aa

File tree

1 file changed

+5
-2
lines changed
  • packages/fern-docs/bundle/src/app/[host]/[domain]/api/fern-docs/revalidate

1 file changed

+5
-2
lines changed

packages/fern-docs/bundle/src/app/[host]/[domain]/api/fern-docs/revalidate/route.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { getEnv, invalidateByTag, waitUntil } from "@vercel/functions";
2929
import { kv } from "@vercel/kv";
3030
import { mapValues } from "es-toolkit/object";
3131
import { escapeRegExp } from "es-toolkit/string";
32-
import { revalidatePath } from "next/cache";
32+
import { revalidatePath, revalidateTag } from "next/cache";
3333
import { type NextRequest, NextResponse } from "next/server";
3434
import { UnreachableCaseError } from "ts-essentials";
3535
import { getFaiClient } from "@/getFaiClient";
@@ -63,7 +63,10 @@ export async function GET(
6363
const start = performance.now();
6464

6565
const { host, domain } = await props.params;
66-
await invalidateByTag(domain);
66+
revalidateTag(domain);
67+
68+
// delay to ensure invalidation propagates before cache is accessed
69+
await new Promise((resolve) => setTimeout(resolve, 500));
6770

6871
const stream = new ReadableStream({
6972
async start(controller) {

0 commit comments

Comments
 (0)