I'm facing an issue with my JSON data file that I want to display on the screen. I have a function with a fetch() request that executes every time I click a button. Initially, it works perfectly by fetching the data and displaying it correctly. However, when new content is added to the JSON file and I click the button again in the same session, the data remains the same as the first time. I've verified that the code after the fetch() function runs (such as console.log(data.length);). Despite researching the Fetch API extensively, I haven't found a solution to this problem. I came across a thread mentioning that the fetch() function only runs once, which seems to align with my issue.
function fetchJSON() {
fetch("static/json/pool_values.json")
.then(response => response.json())
.then(data => {
console.log(data.length);