Skip to content

Commit 3e51c09

Browse files
committed
perf(preloader): unlimited preload for 100% sure
It can only be exactly 100% if it's a part of the static graph of a running qrl, and so we must tell the browser about everything.
1 parent 77056ce commit 3e51c09

File tree

1 file changed

+2
-1
lines changed
  • packages/qwik/src/core/preloader

1 file changed

+2
-1
lines changed

packages/qwik/src/core/preloader/queue.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ export const trigger = () => {
8686
Math.max(1, config[maxSimultaneousPreloadsStr] * probability)
8787
: // While the graph is not available, we limit to 2 preloads
8888
2;
89-
if (preloadCount < allowedPreloads) {
89+
// When we're 100% sure, everything needs to be queued
90+
if (probability === 1 || preloadCount < allowedPreloads) {
9091
queue.shift();
9192
preloadOne(bundle);
9293
} else {

0 commit comments

Comments
 (0)