How to avoid sending duplicate requests?
It is common to see the client side sending duplicate fetch data requests to an API endpoint or desktop page.
To avoid sending duplicate requests, I recommend to implement a caching function that caches HTTP responses.
Example:
// WARNING: this is sudo code, test before use!
const promiseCache = {}