Because loading the most recent ten commit messages seems to be causing a lot of lag for clients, have the server maintain a queue of the 10 most recent commit messages and publish that to the clients.
Create a capped collection for this:
https://docs.mongodb.org/manual/core/capped-collections/