Next.js Discord

Discord Forum

Unexpected identification of all pages as ISR

Answered
New Guinea Freshwater Crocodile posted this in #help-forum
Open in Discord
New Guinea Freshwater CrocodileOP
Hello,

I've recently migrated my entire website from the pages router to the app router.

After I deployed this change to Vercel, I can now see massive spikes in usage for Data Cache Reads / Edge Requests / Data Transfer etc.

From what I can tell, all of my pages are now treated as ISR and presumably not being cached and are re-invalidated frequently.

I'm not clear as to WHY my pages are identified as ISR. As far as I'm aware I don't make use of any getStaticProps or fetch operations in my pages.

Not sure if helpful, but for context: All of my pages are essentially the same format, a server component page.tsx with:

export default function Page() {
    return (
        <div>
            <Suspense><SomeClientComponent/></Suspense>
        </div>
    )
}


Any help in understanding this would be greatly appreciated!
Answered by New Guinea Freshwater Crocodile
For anyone accidently stumbling on to this (probably not), I also created a community post where I asked and answered my own question: https://vercel.community/t/pages-incorrectly-classified-as-isr/237

tl;dr - Static exports are your friend if you don't need ISR and hosting on Vercel that for some reason thinks static webpages are ISR.
View full answer

17 Replies

American black bear
What version of NextJS do you use
New Guinea Freshwater CrocodileOP
14.1.1
American black bear
New Guinea Freshwater CrocodileOP
oh so potentially just inserting something like
export const revalidate = 604800


will influence the re-generation?
I see, I didn't know I can configure it per route segment like this, seems .. promising
American black bear
I dont know if its 14 in general or some time in the middle but server side fetch does not cache requests anymore so when you have multiple times the same url it does it multible times
New Guinea Freshwater CrocodileOP
All of my pages are "unique" in a sense so I essentially have 34 static pages + same layout for each.

But looking atVercel it's mainly 3-4 top pages (that people visit as their bookmark) that trigger the generation
I'm seeing 200k or so invocations in the last 7 days and my deployment rolling out this change hasn't even been a week so I expect that number to be slightly larger per week.
Either way the route segment revalidate option seems like a good option to roll out and test the impact, thanks for the suggestion!
I still don't understand WHY it's considered ISR but solving the usage comes first
Hmm actually reading the docs, the settings says this:
false (default): The default heuristic to cache any fetch requests that set their cache option to 'force-cache' or are discovered before a dynamic function is used. Semantically equivalent to revalidate: Infinity which effectively means the resource should be cached indefinitely.

So I would expect it to be cached indefinitely as I haven't configured it 🤔
American black bear
Yes when a Request somewhere in the stack does not invalidates the caches for the elements downstream
New Guinea Freshwater CrocodileOP
Rolling out a change with
export const revalidate = 604800


across my top 4 pages didn't seem to make a dent, rather hard to tell in a short time frame but I feel like the Data Cache Reads are going as fast as before
New Guinea Freshwater CrocodileOP
I'm lost, I don't know what to do to stop Vercel from thinking my pages are ISR even though they are clearly static pages that hydrate client side.

* I've removed my entire layout page and tried a build, still detected all pages as ISR.
* I've changed my pages (which are server components) to simply have return <></> and still that page was treated as ISR
* I've removed every suspense boundary in my codebase, still all marked as ISR

I'm not really sure where to go from here
American black bear
the only thing i can think of is a middle ware but how nextjs works it can not be the problem
New Guinea Freshwater CrocodileOP
I don't have any middlewares configured as far as I'm aware 🤔
New Guinea Freshwater CrocodileOP
For anyone accidently stumbling on to this (probably not), I also created a community post where I asked and answered my own question: https://vercel.community/t/pages-incorrectly-classified-as-isr/237

tl;dr - Static exports are your friend if you don't need ISR and hosting on Vercel that for some reason thinks static webpages are ISR.
Answer