Hello guys
It looks like Netlify doesn’t take account query parameters on SSR pages in NextJS /pages router.
Example these 2 requests returns the same data for us:
https://coh3-stats-dev.netlify.app/_next/data/3wfhIyuys3kJpwlm-6mxt/leaderboards.json?race=german&type=1v1
https://coh3-stats-dev.netlify.app/_next/data/3wfhIyuys3kJpwlm-6mxt/leaderboards.json?race=german&type=2v2
Our cache headers are setup like this:
res.setHeader("Cache-Control", "public, max-age=30, s-maxage=60, stale-while-revalidate=120");
We don’t have any header modification in next.config.js / we don’t use any middleware to mess with anything. We are on:
@netlify/plugin-nextjs": "5.8.1",
"next": "14.2.18",
"netlify-cli": "17.37.2",
netlify.toml
[[plugins]]
package = "@netlify/plugin-nextjs"
[build]
command = "yarn next build"
publish = ".next"
From the docs I can see that the query parameters should be part of the cache?
So - the question is why is that not happening? Why is the cache key the same? Do we have setup extra netlify configs for this? (I think query should be part of cache key without any configs)
Btw we migrated from another NextJS provider - and our app worked there without any troubles.
Thank you