jaracas's avatar

Can Inertia be used like this? Lots of components that update frequently

I'm starting a new personal project that will have multiple (As many as 10, possibly more) components that need to be updated every 250-500ms with updated data, all the data is pretty lightweight but with 10 components doing it I have to wonder if it'd be better to just use Laravel as an API and poll the server myself with something like axios.

For the record, my project is a PBBG (Persistent Browser-Based Game), and components will be for things like player health, stamina, currency, a list of players in the same area, etc..

"Shared Data" seems like it may be a solution since it looks like I can just write a middleware that sends the necessary data every update conditionally. Would using this be a good idea, or should I just roll my own solution?

0 likes
3 replies
Mega_Aleksandar's avatar

Hi @jaracas ,

I would advise against polling the server for this - might be good to look into Echo and WebSockets. They are the ones that connect your backend and whatever frontend you need in real time, so no need for polling.

As for Inertia - yes, it can handle that easily - from my experience with vue3 and inertia, no problems in updating multiple components, given that you know where your source of truth is and which parts of the data are/should be reactive.

Hope I nudged you a bit in the right direction and good luck in your endeavour.

Best regards,

1 like
jaracas's avatar

Thanks for the reply, would you suggest using Reverb + Redis? Am I wrong in thinking that Reverb keeps your code in memory and uses websockets instead of having the client make a request every time it needs updated data?

Eimmaarose's avatar

Inertia isn’t ideal for high-frequency updates. It’s better for user-driven actions, not data that refreshes every few hundred milliseconds. For fast updates, API polling (Axios) or WebSockets performs much better, since constant Inertia re-renders add unnecessary overhead. Same idea I follow when building real-time systems for services — even outside tech, like how bail bonds Tampa services at https://www.aftermathbailbonds.com/ rely on fast, reliable updates. For your PBBG, stick with API requests or a real-time setup instead of pushing Inertia past its limits.

Please or to participate in this conversation.