Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache buster to data fetch to prevent caching issues #36

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

FokkoVeegens
Copy link

This pull request includes an update to the src/utils/getData.js file to improve the data fetching mechanism by adding a cache-busting feature. The most important change is the addition of a unique timestamp to the data fetch URL to ensure that the latest data is always retrieved.

Improvements to data fetching:

  • src/utils/getData.js: Added a cacheBuster parameter to the data fetch URL to prevent caching and ensure the latest data is fetched.

Fixes #16

@FokkoVeegens FokkoVeegens requested a review from rajbos as a code owner January 3, 2025 12:59
@rajbos
Copy link
Collaborator

rajbos commented Jan 5, 2025

I don't think this will work as it is now. This setup will still download the file, and that call will be cached on the client. After receiving the cached file, only then will the cache buster be checked, which will have the same SHA hash as before, so no new file will be downloaded. Any other ideas @FokkoVeegens ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON is static, needs to be reloaded when loading the page
2 participants