-
Notifications
You must be signed in to change notification settings - Fork 9
optimize useNetworkConfig /api/config fetch calls #474
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededready-for-workTriaged: scope, plan, and DoD are clear; contributor can pick upTriaged: scope, plan, and DoD are clear; contributor can pick up
Milestone
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededready-for-workTriaged: scope, plan, and DoD are clear; contributor can pick upTriaged: scope, plan, and DoD are clear; contributor can pick up
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
🐱 Todo
useNetworkConfigalways performs a fresh fetch on mount. On the landing page you now render bothNetworkSwitcher(in the header) andNetworkBadge, so this will trigger duplicate/api/configrequests on initial load. Consider introducing a shared cache (module-level promise/result, a context/provider, or a data-fetching library) so multiple consumers reuse the same request/result.Originally posted by @Copilot in #472 (comment)
we should make sure we aren't unnecessarily pinging /api/config.. confirm backend has cached response (it should be the same per startup) or that we optimize calls on the front-end. no need to make unnecessary network calls if we can help it easily