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.
This commit is contained in:
medievalshell
2026-05-30 00:15:07 +02:00
parent 4f133abe33
commit 4e96355a94
+5
View File
@@ -31,6 +31,11 @@ const preloadUrl = async (url: string): Promise<void> =>
{
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' });