Fix slow loading of charts on markets page for popular trading pairs #285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Background]
The Bisq Website features a /markets page which fetches historical trade and live offer data from the Bisq Markets API, and plots the data on graphs and tables. This page is located at https://bisq.network/markets
[Issue]
A few markets on Bisq have become quite popular, such as USD, EUR, and XMR. For these busier markets, the full data is now quite heavy because the website requests data with
interval=minute
- the responses have reached several MB in size. The result is that these busy market pages are slow to load:https://bisq.network/markets/?currency=btc_usd
https://bisq.network/markets/?currency=btc_eur
https://bisq.network/markets/?currency=xmr_btc
[Fix]
By changing the data from
interval=minute
tointerval=day
the response size returns to a more reasonable size (100KB ~ 300KB). The tradeoff is that some charts will have slightly lower resolution due to the smaller datapoints, but the charts will load instantly instead of the current several second load time.https://deploy-preview-285--bisq-website.netlify.com/markets/?currency=btc_usd
https://deploy-preview-285--bisq-website.netlify.com/markets/?currency=btc_eur
https://deploy-preview-285--bisq-website.netlify.com/markets/?currency=xmr_btc