#revalidate every second
1 messages · Page 1 of 1 (latest)
i generally wouldn't revalidate every second because that's going to hit all matching loaders
but if you have a fetcher polling a resource route every second that's ok
SSE's will let the server determine when to send new data, so that can be better if it isn't guaranteed to change every second
or if it might change faster than that
is it possible to poll the current root loader without cause all mathcing loaders to fire?
technically yes, but it requires adding shouldRevalidate to your other loaders
I'd recommend a resource route that calls the same functions your root loader does
possibly you could just make it call the root loader function itself
i meant route loader sorry
might be able to do a resource route like this
import { loader as rootLoader } from '../root.tsx'
export async function loader(args: LoaderFunctionArgs) {
return rootLoader(args)
}
hitting all matching loaders isn't the worst thing in the world
if your route is highly nested like there's 4 or 5 routes above then there's gonna be extra server load happening a lot