How to cache static SSG pages on vercel?

Hi gang, I’m playing around with nextjs 15 and I’m trying to better understand the whole SSG part and output static pages. The problem I can see right now is that these static pages don’t get cached. And I’m not sure if I’m missing something.

I created a page under app>[locale]>cache-test/page.js

The page itself:

export function generateStaticParams() {
    return [{ locale: 'en' }, { locale: 'da' }];
}

export const revalidate = 3600;
export default function CacheTest() {


    return (
        <section className="cache-test">
            <h1>This page should be static!</h1>
        </section>
    );
}

When i run the build, i can see the static files are generated:

├ ● /[locale]/cache-test 1.66 kB 111 kB

├ ├ /en/cache-test

├ └ /da/cache-test

and I can access them just fine on localhost, however in the response header, i can see the following:

cache-control:private, no-cache, no-store, max-age=0, must-revalidate

So I guess this means the page is not getting cached at all.

Am i missing something?

I realized that my site is using some dynamic data for the user account so nextjs automatically switches to SSR. Adding force-static works, but then I need to move the login functionality to client-side

1 Like