Ethora Community

Community › Developers (platform specific questions) › React.js (Web)

Chat history caching logic update in Ethora Chat Component

Archived from the Ethora community forum. First posted on 28 January 2025; product details may have changed since. For current setup see Get Ethora and GitHub.

Before: the entire history, the state of the rooms are cached. When opening the chat again, 5 messages are reloaded to the chats in an asynchronous order with the cache. (Maximum 4 times), or until it finds the last message from the cache by id. The requests are separated with a timeout of 500ms.

After:
No more than 30 messages in the cache, so that additional downloads work optimally and during the user's idle state.
This will solve the issue of updating old messages, because keeping about the entire history will not be very correct.

Afterwards we keep improving the caching logic until the moment when we have the most messages cached and performance optimized.

 

Have a question about this? Ask the Ethora team.