mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
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:
@@ -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' });
|
||||
|
||||
Reference in New Issue
Block a user