caching messages to detect duplicates from the same ID (issue #119)