mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 18:15:23 +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 };
|
let fileMeta = { rev: '', size: 0 };
|
||||||
|
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
const fileUrl = '/dropbox-file/scl/fi/nkyabkq2jdwfudof2ovrl/Data-Matrix.xlsx?rlkey=1cz5fuabwipqqivihii7sybw0&st=io0g4wvb&dl=1';
|
const cacheBuster = `t_${Date.now()}`;
|
||||||
console.log('Fetching Data-Matrix.xlsx from Dropbox...');
|
const fileUrl = `/dropbox-file/scl/fi/nkyabkq2jdwfudof2ovrl/Data-Matrix.xlsx?rlkey=1cz5fuabwipqqivihii7sybw0&st=io0g4wvb&dl=1&${cacheBuster}=${Date.now()}`;
|
||||||
const response = await fetch(fileUrl);
|
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}`);
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||||
const arrayBuffer = await response.arrayBuffer();
|
const arrayBuffer = await response.arrayBuffer();
|
||||||
if (arrayBuffer.byteLength < 100) throw new Error('File too small');
|
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('File meta:', fileMeta);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Fetching Data-Matrix.xlsx from proxy...');
|
console.log('Fetching Data-Matrix.xlsx from proxy (hard refresh)...');
|
||||||
const response = await fetch('/api/dropbox-proxy');
|
const response = await fetch('/api/dropbox-proxy', { cache: 'no-store' });
|
||||||
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
||||||
const arrayBuffer = await response.arrayBuffer();
|
const arrayBuffer = await response.arrayBuffer();
|
||||||
if (arrayBuffer.byteLength < 100) throw new Error('File too small');
|
if (arrayBuffer.byteLength < 100) throw new Error('File too small');
|
||||||
|
|||||||
Reference in New Issue
Block a user