Prevent /v2 from being queried too often on accounts page
See original GitHub issueIs your feature request related to a problem? Please describe.
On the explorer’s address
page (example), the v2
endpoint https://stacks-node-api.stacks.co/v2/accounts/XXXXXXXXX?proof=0&unanchored=true
is fetched roughly every 10 seconds. With so many people using the explorer, this could create RPC congestion for stacks-nodes.
Describe the solution you’d like
I’m not sure what data is being used from https://stacks-node-api.stacks.co/v2/accounts/XXXXXXXXX?proof=0&unanchored=true
every 10 seconds, but can it be obtained from a v1
endpoint instead? v1
is much more performant, and will help stacks-nodes propagate transactions faster with less RPC congestion.
Additionally, I feel a 10 second refresh might be too frequent. If this refresh interval could be changed via environment variable, it would allow those hosting it to configure a refresh interval that balances speed and traffic.
Side question - Looks like a few other v1
endpoints are being called at regular intervals in the explorer as well. Can the explorer start leveraging websockets? The API now supports websockets, which would be more performant than standard HTTP requests, and data would be transmitted as soon as it’s received.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top GitHub Comments
@markmhx I think a manual refresh button would end up helping quite a bit for the interim, as most don’t need to refresh every so often.
It may detract a tiny bit from the user experience though. So in the long run if it can be swapped out for a
v1
call or websockets, it would be nice to have auto-refresh re-implemented with that optimization, along with the adjustable env var mentioned in the description.🎉 This issue has been resolved in version 1.28.1 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀