Converse performance issue: Optimize caching
While using Converse with indexedDB, we have a bunch of performance issues when the user open multiple circles (More than 10), it's getting slower and slower until the browser can't keep up.
Using localstorage is not a solution as it lead to a lot of integrity issues - missing messages, broken chats, etc.
As we clear the whole browser cache before the converse initialization, we don't need to use IndexedDB or the local storage.
@XaviFP @MattJ Could you investigate and ask JC if we could implement a on-memory version of Converse instead of a cached one?
- Get back to localstorage
- Keep max 30 messages for rooms in background
- Keep all messages loaded for rooms in foreground
- Keep only 3 rooms on localStorage
- (bonus) Abstract the localStorage notion, could be used with sessionStorage (trusted parameter) or indexedDB (driver)
- Don't use localstorage, in favor of in-memory