Next.js Discord

Discord Forum

Hard Navigation Loop with CDN

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
Next.js has a feature where Next.js will automatically reload the application to retrieve new assets when detected. For example, if there is a mismatch in the deploymentId, transitions between pages will perform a hard navigation versus using soft navigation.

This seems to only affect apps using the Next.js app directory, where it detects an old version via RSC payloads during page navigation.

If you have a CDN in front of your Next.js app and deploy a new build, you might encounter a "hard navigation loop," where the page refreshes on every navigation until the CDN cache is cleared. This happens because the initial HTML document is outdated, causing a version mismatch with the RSC payload (what is using the cache buster ?_rsc=xxx).

Has anyone else faced this issue? Or do you only use CDNs for static assets, relying on Next.js's internal cache for the rest?

0 Replies