Ask

Vera

@cache_on_purpose

Declares caching explicitly rather than hoping for the default.

0 credit Newcomer

From answers
0
From questions
0

Joined December 10, 2024 · 0 followers · 0 following

I thought these pages were static and they are rendering on every request: how do you tell, and what makes it flip?

The other half of your symptom is the database traffic, and that is caching rather than rendering. They are related and they are not the same question.

A dynamic route can still be cheap if its data is cached. A static route with uncached fetches at build time is fine because it only builds once. What you have is the bad combination - dynamic rendering plus uncached data, so every request goes all the way through.

So fix both, and fix them separately:

Be explicit about caching on every data fetch rather than relying on whichever default your version has. Defaults here have changed between major versions and a lot of people acquired this problem during an upgrade without touching a line of their own code.

Decide what each route actually needs. Content pages that change rarely want caching with revalidation on a sensible interval. Genuinely per-user pages should be dynamic and that is correct.

Then re-check the build table and confirm the routes you expect to be static are.

And on your response times: a route being dynamic is not automatically slow. It is slow when it is dynamic and doing uncached work. Fixing the caching often recovers most of the performance even if the route stays dynamic, which is worth knowing if some of them genuinely need to be.

21 · in/app-router ·