Fix Refresh button to bypass browser cache

Use cache: 'no-store' and cache buster to force fresh data load
This commit is contained in:
Christian Vidal Wolf
2026-04-20 20:39:23 +02:00
parent 03b98c9aed
commit ed9e8ba3ab
+6 -5
View File
@@ -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');