Next.js Discord

Discord Forum

"use cache" route marked as dynamic by dev tools

Answered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
I have a home page which is marked with "use cache", however the dev tools in the bottom left screen say that my home route / is dynamic. Is this a bug or am I not caching the page properly?

It is also worth noting that I am using route specific layout feature for my homepage e.g. /src/app/(main)/page.tsx.
Answered by American black bear
I can confirm that the page is indeed cached with "use cache" marked on top of the file, but the dev tools say that the route is dynamic. Probably a bug.
View full answer

5 Replies

I don't think the use cache is to be marked at the top but inside the function itself
that's all you need to know to use it well.
in case the migration has been performed previously and the page.tsx component does not working as expected, please mention it.
American black bearOP
I can confirm that the page is indeed cached with "use cache" marked on top of the file, but the dev tools say that the route is dynamic. Probably a bug.
Answer