diff --git a/Dockerfile b/Dockerfile index 945db33..91a20e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,11 +15,15 @@ RUN echo 'server { \ try_files $uri $uri/ /index.html; \ } \ \ - # Cache static assets \ - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { \ + # Cache static assets (short TTL for JS to allow updates) \ + location ~* \.(png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { \ expires 1y; \ add_header Cache-Control "public, immutable"; \ } \ + location ~* \.(js|css)$ { \ + expires 1h; \ + add_header Cache-Control "public, must-revalidate"; \ + } \ \ # Gzip compression \ gzip on; \ diff --git a/js/safe-api.js b/js/safe-api.js index c3d13a2..9365667 100644 --- a/js/safe-api.js +++ b/js/safe-api.js @@ -162,7 +162,7 @@ const SafeAPI = (() => { } catch (e) { // Chain doesn't have this Safe or API error - skip } - await sleep(150); + await sleep(300); } return results; @@ -173,12 +173,14 @@ const SafeAPI = (() => { * Returns { info, balances, outgoing, incoming } */ async function fetchChainData(address, chainId) { - const [info, balances, outgoing, incoming] = await Promise.all([ - getSafeInfo(address, chainId), - getBalances(address, chainId), - getAllMultisigTransactions(address, chainId), - getAllIncomingTransfers(address, chainId), - ]); + // Fetch sequentially to avoid rate limits + const info = await getSafeInfo(address, chainId); + await sleep(200); + const balances = await getBalances(address, chainId); + await sleep(200); + const outgoing = await getAllMultisigTransactions(address, chainId); + await sleep(200); + const incoming = await getAllIncomingTransfers(address, chainId); return { chainId, info, balances, outgoing, incoming }; } diff --git a/wallet-multichain-visualization.html b/wallet-multichain-visualization.html index 42e16ff..0d7c5a0 100644 --- a/wallet-multichain-visualization.html +++ b/wallet-multichain-visualization.html @@ -5,9 +5,9 @@