diff --git a/package.json b/package.json index deceed3..8e66bc0 100644 --- a/package.json +++ b/package.json @@ -17,4 +17,4 @@ "vite-plugin-html": "^3.2.2", "vite-plugin-rewrite-all": "^1.0.2" } -} \ No newline at end of file +} diff --git a/src/utils/getData.js b/src/utils/getData.js index e1d5e1a..73eea17 100644 --- a/src/utils/getData.js +++ b/src/utils/getData.js @@ -3,16 +3,14 @@ import basename from "../../react-config"; let cachedData = null; const getData = async () => { - if (cachedData) { - return cachedData; - } try { - const response = await fetch(`${basename}data.json`); + // Fetch the file hash without caching + const response = await fetch(`${basename}data.json`, { cache: 'no-store' }); if (!response.ok) { throw new Error('Network response was not ok'); } - cachedData = await response.json(); - return cachedData; + const data = await response.json(); + return data; } catch (error) { console.error('Fetch error:', error); throw error;