Replies: 1 comment
-
Here is how it is determined if the indicator shows up: next.js/packages/next/next-server/lib/router/router.ts Lines 529 to 531 in 38bd1a0 and here is the usage of it: next.js/packages/next/client/dev/prerender-indicator.js Lines 83 to 86 in 38bd1a0 To answer your first question, when you see this indicator in a page it mean that it does qualify for Automatic Static Optimization. As for your second question, it looks like the indicator is set when the router's |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As I was reading the docs, I found the description of the static indicator a little bit confusing:
My first question is: When I see this indicator in a page, does it mean my page is currently NOT statically optimized and it could be optimized by getStaticProps? If my assumption is correct, I think it would be better to show the indicator when your page is in fact already optimized, and the lack of indicator to show your page is not optimized.
Now, as I was working on a quick demo to test
getStaticProps
andgetStaticPaths
I realized the indicator is not consistent with what I see:I have an
index.js
page and a[category].js
page. The index page does exactly the same as the category so its code is the following:And
[category].js
has agetStaticProps
andgetStaticPaths
to statically generate pages, but what I see is that on initial load of any of those pages I don't see the indicator, but as soon as I click any of the dynamic<Link>'s
I see the indicator appear in the bottom right corner.So my second question is, why I don't see the indicator on each initial load of any page, but as soon as I click links I see the indicator again?
This gif reflects the behavior I'm describing, you can see when I do a full refresh vs moving between pages clicking
<Link>
.The code for
[category].js
is this, so far I don't think there's a problem with it:Beta Was this translation helpful? Give feedback.
All reactions