Closed alvarlagerlof closed 1 year ago
just to check, you are using Bright on a dynamic
page right?
It's not explicitly dynamic. It just has revalidate
set.
@alvarlagerlof if you change from a revalidate
route config to instead setting revalidate
on individual fetches then this problem should go away I think - those grammars and themes will be cached forever.
@alvarlagerlof if you change from a
revalidate
route config to instead settingrevalidate
on individual fetches then this problem should go away I think - those grammars and themes will be cached forever.
I don't trigger this fetch from my code. It's started by bright I think just by rendering the component on the server.
Yes, but the default for Next.js will be to cache the fetch forever - if you have a revalidate
route config then the grammars/themes will be refetched every time instead. You're telling Next.js to refetch in this instance.
This is why the Next.js docs recommend revalidating only the fetches you need instead of using the route segment config.
Yes, but the default for Next.js will be to cache the fetch forever - if you have a
revalidate
route config then the grammars/themes will be refetched every time instead. You're telling Next.js to refetch in this instance.This is why the Next.js docs recommend revalidating only the fetches you need instead of using the route segment config.
Ah, my bad. I did misunderstand you. But now that I get your point, I remembered why it put it there. The main thing I want to have revalidating is a data fetch to sanity, using their JS package. I don't believe we have a way to control fetches like that yet right?
Nope, not unless sanity allows you to pass the fetch options somehow (or swap out the fetch function entirely). It's the same issue as I just raised in lighter that's linked above.
Nope, not unless sanity allows you to pass the fetch options somehow (or swap out the fetch function entirely). It's the same issue as I just raised in lighter that's linked above.
Ah damn. I see. Your issue makes more sense (and on the right package, so I'll close this one).
I noticed these fetches happening in my Vercel dashboard and they seem to be mostly uncached. I wouldn't expect those files to change often. Is there a way that you / I can cache them?