#revalidate every second

1 messages · Page 1 of 1 (latest)

wise bay
#

is revalidating every second fine? or would it be better to do something like Server-Sent events?

quaint veldt
#

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

wise bay
#

is it possible to poll the current root loader without cause all mathcing loaders to fire?

quaint veldt
#

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

wise bay
#

i meant route loader sorry

quaint veldt
#

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