Why a URL Alone Is Not Enough to Cache Next.js RSC
Hina NakahiraCo-founder & CEO at Arkor
The same visible path can be requested as a document or as App Router navigation data. A CDN rule that stores both under one undifferentiated key can return the wrong representation. Cache the framework's request variants correctly, not just the URL a person sees.
This is why “cache every GET request” is not a safe Next.js deployment plan.
The path is only one part of the request
A visitor types a product URL into the address bar. Later, the same visitor reaches that product through an internal link. Those actions can require different response formats.
The Next.js CDN guide documents the framework's current header and request-variant requirements. The HTTP Vary reference explains the broader reason: a response can depend on more than its path.
These are distinct representations of an application route, not interchangeable blobs.
A high cache hit rate can be a failure
Imagine the navigation response populates a path-only cache first. A direct visitor then receives that stored navigation representation. The cache may proudly report a hit even though the response is unsuitable for a document load.
The reverse ordering can fail too. Therefore, a useful test must vary both the request type and the order in which the cache is primed.
Run this only against your own controlled test deployment. Preserve response bodies as fixtures only when they contain no private data.
Capture requests from your actual version
Do not manufacture a navigation request by copying a header list from an old blog post. Capture a real navigation from the application's pinned framework version and adapter.
Record the request headers, query parameters, response content type, and routing behavior. Review the current platform guidance before configuring normalization or custom cache keys.
Framework protocols evolve. A workaround for one version may be unnecessary or wrong for another. Prefer a supported adapter integration over a growing collection of guessed edge rules.
Treat query cleanup as a correctness change
Removing tracking parameters can sometimes improve reuse, but a framework parameter is not necessarily tracking data. Neither is a signature, an access grant, or an input that changes the page.
Make an allowlisted distinction between parameters your application truly ignores and parameters whose meaning you have not established. Do not strip unknown query parameters from signed or authenticated requests.
Test redirects and intercepting routes as well as a simple detail page. A cache rule that works on the home page is not evidence that it preserves the full routing protocol.
Build a small representation test matrix
For one route, test a cold direct load, a warm direct load, internal navigation, and a prefetch followed by navigation. Repeat after priming in the opposite order.
Assert the expected content type and the visible result. Include a not-found route and a redirected route. Then run the same checks after deployment and invalidation.
For authenticated applications, add two separate test sessions. Do not permit a delivery optimization to merge responses that differ by authorization context.
Keep the optimization subordinate to the contract
A CDN is allowed to reuse a response only when that response is valid for the next request. Fast delivery of the wrong representation is still broken delivery.
The right question is not “Can Cloudflare cache this path?” It is “Which representations can this route produce, and does the supported delivery integration distinguish them?” Answer that before tuning hit rates.
About the author

Co-founder & CEO at Arkor