I am currently testing my Next.js application on Digital Ocean. After deploying it, I noticed that the getStaticProps revalidation feature is not working. Upon examining the cache headers, I observed that the revalidation parameter is being assigned to Cache-Control as follows:
Cache-Control: s-maxage=10800, stale-while-revalidate
My intention was to instruct Next.js to regenerate the page every 3 hours in order to update data. However, there seems to be a synchronization issue between Next.js and Cloudflare. The current status is:
Cf-Cache-Status: HIT
X-Nextjs-Cache: STALE
This indicates that Next.js considers the page expired, but Cloudflare does not. Therefore, even if Next.js regenerates the page in the background, the new version will not be displayed until the Cloudflare cache also expires.
I am looking for a solution to synchronize them. Currently, the application does not have a domain, so all aspects are managed by Digital Ocean. I am unsure whether this syncing issue is related to Digital Ocean, or if it can be resolved through configuration adjustments on either Next.js or Cloudflare.