Function saveMessage

Save a message to the cache