From ed9e8ba3abd04a6e2cbd1ec83675f101a752c908 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Mon, 20 Apr 2026 20:39:23 +0200 Subject: [PATCH] Fix Refresh button to bypass browser cache Use cache: 'no-store' and cache buster to force fresh data load --- src/App.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ff318ed..2d6dcc7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -60,9 +60,10 @@ export default function App() { let fileMeta = { rev: '', size: 0 }; if (isDev) { - const fileUrl = '/dropbox-file/scl/fi/nkyabkq2jdwfudof2ovrl/Data-Matrix.xlsx?rlkey=1cz5fuabwipqqivihii7sybw0&st=io0g4wvb&dl=1'; - console.log('Fetching Data-Matrix.xlsx from Dropbox...'); - const response = await fetch(fileUrl); + const cacheBuster = `t_${Date.now()}`; + const fileUrl = `/dropbox-file/scl/fi/nkyabkq2jdwfudof2ovrl/Data-Matrix.xlsx?rlkey=1cz5fuabwipqqivihii7sybw0&st=io0g4wvb&dl=1&${cacheBuster}=${Date.now()}`; + console.log('Fetching Data-Matrix.xlsx from Dropbox (hard refresh)...'); + const response = await fetch(fileUrl, { cache: 'no-store' }); if (!response.ok) throw new Error(`HTTP ${response.status}`); const arrayBuffer = await response.arrayBuffer(); if (arrayBuffer.byteLength < 100) throw new Error('File too small'); @@ -81,8 +82,8 @@ export default function App() { console.log('File meta:', fileMeta); } - console.log('Fetching Data-Matrix.xlsx from proxy...'); - const response = await fetch('/api/dropbox-proxy'); + console.log('Fetching Data-Matrix.xlsx from proxy (hard refresh)...'); + const response = await fetch('/api/dropbox-proxy', { cache: 'no-store' }); if (!response.ok) throw new Error(`HTTP ${response.status}`); const arrayBuffer = await response.arrayBuffer(); if (arrayBuffer.byteLength < 100) throw new Error('File too small');