import axios from 'axios'

const metadataCache = {}
const client = axios.create({timeout: 60 * 1000})

export async function fetchUrl(url, isBinary = false) {
  if (isBinary) {
    return fetch(url, 'arraybuffer')
  }

  if (!metadataCache[url]) {
    metadataCache[url] = await fetch(url, 'json')
  }
  return metadataCache[url]
}

async function fetch(url, responseType) {
  return (await client.get(url, {responseType})).data
}

@@ -18,16 +18,42 @@
  'axios'
+%0Aimport https from 'https'
 %0A%0Aconst 
@@ -100,16 +100,69 @@
 create(%7B
+%0A  httpsAgent: new https.Agent(%7BkeepAlive: true%7D),%0A  
 timeout:
@@ -166,17 +166,17 @@
 ut: 
-6
+1
 0 * 1000
 %7D)%0A%0A
@@ -171,16 +171,17 @@
 0 * 1000
+%0A
 %7D)%0A%0Aexpo

Enable HTTP keepAlive to speed up synchronisation two-fold