perf: improve admin page cold starts
This commit is contained in:
@@ -68,11 +68,11 @@ function scheduleIdle(callback: () => void) {
|
||||
const browserWindow = window as WindowWithIdleCallback;
|
||||
|
||||
if (browserWindow.requestIdleCallback) {
|
||||
browserWindow.requestIdleCallback(callback, { timeout: 3000 });
|
||||
browserWindow.requestIdleCallback(callback, { timeout: 8000 });
|
||||
return;
|
||||
}
|
||||
|
||||
window.setTimeout(callback, 1200);
|
||||
window.setTimeout(callback, 8000);
|
||||
}
|
||||
|
||||
function canPrefetch() {
|
||||
@@ -160,7 +160,7 @@ function prefetchAiPlatformPages(currentPath = '') {
|
||||
}
|
||||
|
||||
if (isSystemRoute(currentPath)) {
|
||||
delayedPrefetch(`core:${currentPath}`, corePrefetchTasks, 8000);
|
||||
delayedPrefetch(`core:${currentPath}`, corePrefetchTasks, 18_000);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ function prefetchAiPlatformPages(currentPath = '') {
|
||||
delayedPrefetch(
|
||||
`agent-chat:${currentPath}`,
|
||||
[aiPrefetchTasks.agentChat, aiPrefetchTasks.aiChatPanel],
|
||||
6000,
|
||||
14_000,
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -177,12 +177,12 @@ function prefetchAiPlatformPages(currentPath = '') {
|
||||
delayedPrefetch(
|
||||
`ai:${currentPath}`,
|
||||
getAiRoutePrefetchTasks(currentPath),
|
||||
6000,
|
||||
14_000,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
delayedPrefetch('core:home', corePrefetchTasks, 10_000);
|
||||
delayedPrefetch('core:home', corePrefetchTasks, 22_000);
|
||||
}
|
||||
|
||||
export { prefetchAiPlatformPages };
|
||||
|
||||
Reference in New Issue
Block a user