use_navigate and Firefox network.http.max-persistent-connections-per-server #1894
Replies: 1 comment 4 replies
-
A good example of how to handle this better would be to cancel in-flight requests using the browser's leptos/examples/hackernews/src/api.rs Lines 12 to 38 in 17b3300 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a leptos
0.5
app with strange behavior when usinguse_navigate
. Every route does between 1 and 5 requests usingreqwest
when opened.When switching fast between the routes, the app gets stuck on the 7th route change. All network requests are loading but never return. The first request that is done is marked as blocked by Firefox.
I found this on the web: https://stackoverflow.com/questions/43783829/what-does-blocked-really-mean-in-the-firefox-developer-tools-network-monitorin
This took me to the Firefox
network.http.max-persistent-connections-per-server
setting which is 6 per default. Increasing this value to eg. 10, the leptos app gets stuck at the 11th route change.So to me it seems, that leptos is making a new connection to the server on every route change, but not reusing already created ones? At least there seems to be a connection between the value of the setting in Firefox and route changes in leptos.
Are there any tricks or pitfalls with
use_navigate
that I need to consider to prevent this behavior? What am I doing wrong?I also tested with
gloo
for the requests, but there is no difference.Beta Was this translation helpful? Give feedback.
All reactions