From 4e96355a948bd63eccfd9b0d88c73cd0d7f7d515 Mon Sep 17 00:00:00 2001 From: medievalshell Date: Sat, 30 May 2026 00:15:07 +0200 Subject: [PATCH] perf(boot): non pre-fetchare le URL gamedata directory preloadUrl salta le URL che finiscono con '/' (le gamedata split sono directory): prima 404avano e sprecavano connessioni all'avvio. --- src/App.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 55fce02..4b799ef 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -31,6 +31,11 @@ const preloadUrl = async (url: string): Promise => { if(!url) return; + // Split gamedata URLs are directories (end with '/'); fetching them as a + // file just 404s and wastes a connection at startup. The real split loader + // handles those — only warm up actual file URLs here. + if(url.split('?')[0].split('#')[0].endsWith('/')) return; + try { const response = await fetch(url, { cache: 'force-cache' });