Help Needed with Data Fetching and Caching Issue on Netlify

I am currently working on a project hosted on Netlify: https://vote-koma.netlify.app/. This web application is built using Next.js, and I have implemented a function to fetch Redis data via an API endpoint: https://vote-koma.netlify.app/api/vote.

However, I am encountering an issue where the data fetched does not seem to be the latest. It appears there might be caching involved with the GET request, as there are no new logs generated when the request is made.

Interestingly, this function works perfectly on Vercel. You can see the working version here: https://koma-vote-monitor.vercel.app/, with the corresponding API endpoint: https://koma-vote-monitor.vercel.app/api/vote. The data at getResponse.json().data[-1][0] reflects the latest data time correctly on Vercel.

Given my preference to use Netlify for this project, I would greatly appreciate your assistance in resolving this issue. Could you please help me identify and fix the problem?

Thank you for your time and support.

Based on this test: opennextjs-netlify/src/run/headers.test.ts at main · opennextjs/opennextjs-netlify we add a netlify-cdn-cache-control header to cache for a year if the response sent by Next.js doesn’t include a cache-control header. This is resulting in the response being cached on our CDN was a year.

When you run locally, could you confirm if Next.js is sending a cache-control header for that endpoint? If not, could you try setting a cache-control header. Even no-cache would work, just that somethinng should exist.