Thomas Bruederli wrote:
And what if people open a message to read, click back to list mode and select the next message? Then we doubled the requests to the server again.
Then will be as is now. We can't eliminate every issue, but we could improve performance of moving between messages (with arrow buttons). When you double click message on the list you switch to (let's say) preview mode and now you can move between messages with arrows. Those moves are causing excessive (in my opinion) getunread calls.
We should rather investigate what really causes your performance problems. I cannot believe that reading those message counts does really use so much performance. At least it should not. Probably there's a major bug in RoundCube and we should try to find and fix it before we build some work around which will cause 10 new problems.
I've got disabled caching because of "enable caching of messages and mailbox data in the local database. This is recommended if the IMAP server does not run on the same machine" (from config file). I have a big mailbox with several folders and getunread goes 2-3 secs. It not causes big load, but my goal is to eliminate excessive requests. What if you'll have a few hundreds of simultanous roundcube sessions?
In your proposal request is eliminated but message preview is delayed. The second reason of that discussion is inconsequent roundcube's behaviour (on the other hand it's consequent - getunread on each page load). Finally, I don't think it's a major issue, it's just one block of a whole structure.