Hi, and thanks again, @clarnx.
What I’m testing is a minimal version of the application. It’s a very simple two-page app.
The only thing I’m doing is fetching a string from Sanity:
import { getAbout } from "@/sanity/queries";
import Link from "next/link";
export const revalidate = 60;
export default async function About() {
const [{ title }] = await getAbout();
return (
<div className="content about">
<div className="title">About</div>
<Link href="/">Go to Home</Link>
<div className="text">{title}</div>
</div>
);
}
And getAbout
is defined like this:
export function getAbout() {
return client.fetch(
groq`
*[_type == "about"] {
title,
image
}
`);
}
I solved the issue by adding a second parameter to the fetch
call: { next: { revalidate: 60 } }
.
The fetch call looks like this in the end:
export function getAbout() {
return client.fetch(
groq`
*[_type == "about"] {
title,
image
}
`,
{ next: { revalidate: 60 } }
);
}
So I’m telling it to revalidate both in the fetch and in the whole route.
The conclusion seems to be that Netlify is listening to this parameter in the fetch call, but not to the route revalidate constant, whereas Vercel has enough with the latter.