Rational
We synchronize the cache on each request (and we even tried to reduce the number) but this is a little expensive knowing that such cache should be almost static. Also the commit part needs to search and update/insert row in a table and this may create conflicts.
Proposal
Following the Bus
design, we could have a thread daemon listening on a channel (if the database support it). The message passed to this channel is the name of the cache to clear.
In order to prevent thread started before the clearing to fill the cache with outdated data, we need to order the transaction using a monotonic timestamp which is compared to the last clearing of the Cache instance.
As this will create a database connection per process and database, this should be optional by configuration.
Implementation
https://bugs.tryton.org/issue8019
https://bugs.tryton.org/issue8027