Skip to content

Commit 315717f

Browse files
authored
Disable the background fetch of getRevisionPageDocument (#3313)
1 parent da67711 commit 315717f

File tree

1 file changed

+13
-10
lines changed
  • packages/gitbook-v2/src/lib/data

1 file changed

+13
-10
lines changed

packages/gitbook-v2/src/lib/data/pages.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,19 @@ export async function getPageDocument(
4242
}
4343

4444
// Pre-fetch the document to start filling the cache before we migrate to this API.
45-
if (isInPercentRollout(space.id, 10) || process.env.VERCEL_ENV === 'preview') {
46-
await waitUntil(
47-
getDataOrNull(
48-
dataFetcher.getRevisionPageDocument({
49-
spaceId: space.id,
50-
revisionId: space.revision,
51-
pageId: page.id,
52-
})
53-
)
54-
);
45+
if (process.env.NODE_ENV === 'development') {
46+
// Disable for now to investigate side-effects
47+
if (isInPercentRollout(space.id, 10) || process.env.VERCEL_ENV === 'preview') {
48+
await waitUntil(
49+
getDataOrNull(
50+
dataFetcher.getRevisionPageDocument({
51+
spaceId: space.id,
52+
revisionId: space.revision,
53+
pageId: page.id,
54+
})
55+
)
56+
);
57+
}
5558
}
5659

5760
return null;

0 commit comments

Comments
 (0)