Introduce a translation memory (cache) layer to reduce duplicate translation provider calls for identical messages across different rooms or users, improving performance.
**Component:** AutoTranslate **Type:** Performance Improvement #### Summary While exploring the AutoTranslate module, I noticed a potential opportunity to reduce duplicate translation provider calls. Currently, identical messages across different rooms or users can trigger repeated translation provider calls even though the resulting translation would be identical. Introducing a small **Translation Memory (cache) layer** could allow reuse of translations across messages with the same text, reducing provider API calls and improving response time. #### Current Behavior In the current implementation, translations are stored on the message document itself (e.g., `translations.<lang>`). Before requesting a translation, the client checks whether the translation already exists for that message. Workflow today: 1. A message is sent. 2. AutoTranslate checks if `translations.<target_lang>` exists on the message. 3. If not present → the translation provider is called. 4. The result is stor