EDIT: Just created a project from scratch with the same code and it's working as expected, I'll pay a look on what differences (probably some libraries) are making my project to work in a different way
I'm doing a migration of some of my static pages to the new App Router and I'm facing some 'issues', I don't fully get how the static pages works on the new router, for example one of my pages is connected to Contentful and I followed the tutorials to achieve SSG, in the build the page is labeled as "(Static) prerendered as static content" but logging my "getData" function the page is still doing a call on the first load of the page, after the first load the page seems to be cached and I don't get the log again.
I also did a very simple page in order to test and I get the same behavior, is this normal for my scenario? Should I verify if SSG is working in a different way (not with the logs)?
This is the test page that I created to test, the getData function is called at build time generating the html in the .nexjs folder but also in the first load of the page:
`async function getData() {
console.log("[TESTPAGE] getData"); // This is called on build time and on the first load of the page
const aboutPageData = await fetch(
"http://jsonplaceholder.typicode.com/posts",
{ cache: "force-cache" },
).then((response) => response.json());
return aboutPageData;
}
export default async function listPage() {
const data = await getData();
if (!data) {
return { notFound: true };
} else {
return (
<div>
{data.map((post: any) => (
<div key={post.id}>
<h2>{post.title}</h2>
<p>{post.body}</p>
</div>
))}
</div>
);
}
}`
Any comment will be highly appreciated, thanks in advance!