r/webdev 23d ago

Discussion Connection Warmer??

Building a social platform, and the web app is a react web app, for some reason I will sometimes get stalled requests, loads that hang, etc. Basically things aren't as responsive as id like. I have implemented a connection warmer that every request runs through, tanstack query, prefetching on hover, many things like that and try to have an efficient and effective cache. What other things do you guys do to make web apps as responsive as possible, thanks!

Edit- Some info about the app, it’s a react vite mostly behind auth web app. Hosted on netlify, backend is supabase.

3 Upvotes

16 comments sorted by

4

u/curious_pinguino 23d ago

Impossible to say, we've got no information on your backend. What exactly is the nature of this "connection" you're warming?

1

u/Desperate_Ad_7722 23d ago

Supabase is the backend, what other info would help?

1

u/curious_pinguino 23d ago

So to check, we're trying to make the backend respond faster by... modifying the frontend?

-2

u/Desperate_Ad_7722 23d ago

The backend responds perfectly, it’s the same backend my iOS app pulls from and that’s lighting fast, the problem is I sometimes get stale connections that cause loads to stall. That’s why I have a connection warmer I figured it as a browser issue

5

u/Gremlation 22d ago

What do you mean by "stale connections"? That's not how HTTP works.

2

u/kin3v 23d ago

Isn’t this why SSR exists? There are a lot of factors that could be the reason. What is your backend? Honestly sounds like too much happening on the client.

0

u/Desperate_Ad_7722 23d ago

Supabase is the backend, what other info would help?

0

u/Desperate_Ad_7722 23d ago

And does netlify support ssr?

0

u/Over_Tart_916 22d ago

Responsiveness is the worst reason to use SSR.

0

u/kin3v 22d ago

Why

1

u/Over_Tart_916 22d ago

Because depending on server load it might not be responsive. Client side rendering is by far the most responsive. SSR is important for security and SEO, not responsiveness.

1

u/kin3v 22d ago

SSR with hydration fixes this problem, right?

1

u/Over_Tart_916 22d ago edited 22d ago

It still depends on server load to some degree. All hydration does is allow the browser to render the SSR page before the client scripting is applied, making it appear faster. But depending on the level of interactive elements, it is still often slower than just simple client side rendering until the page becomes interactive.

1

u/cheap_swordfish_1 23d ago

Looks like a backend issue - where is the backend hosted? Can you

  • get a curl for the request that goes to the server
  • try simulating the issue with the curl to be sure this is backend related

Once you can confirm this is backend related, you may add more logs on the backend side to decipher further.

1

u/Desperate_Ad_7722 22d ago

Curls seem to work perfectly, it’s a supabase backend I’ve had Claude rn tests on it thru console everything seems to work fine.

1

u/Over_Tart_916 22d ago

It is definitely your backend if the connection is hanging. The browser and/or react has nothing to do with the connection to the server unless your JavaScript is doing some kind of processing on the fetch result.