Fix: Respect Page-Order in Loading & Memory Eviction (#61, #63, #68)

This commit is contained in:
Youwes09
2026-05-10 02:17:25 -05:00
parent 7b2ae74c02
commit e09ae9d2e7
6 changed files with 320 additions and 110 deletions
+10
View File
@@ -112,7 +112,17 @@ export function deprioritizeQueue(): void {
queue.sort((a, b) => b.priority - a.priority);
}
export function cancelQueuedFetches(): void {
const dropped = queue.splice(0);
for (const entry of dropped) {
inflight.delete(entry.url);
entry.reject(new DOMException("Cancelled", "AbortError"));
}
}
export function clearBlobCache(): void {
cancelQueuedFetches();
cache.forEach(blob => URL.revokeObjectURL(blob));
cache.clear();
inflight.clear();
}