mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:55:24 +02:00
Fix Refresh button to bypass browser cache
Use cache: 'no-store' and cache buster to force fresh data load
This commit is contained in:
+6
-5
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user