Atmosphere/atmosphere — pull request #900 by vinodsral (2013-02-11 21:36:59+00:00)
Title: added the functionality of sending message timestamp along with message

By sending the timestamp of each message appended to message, client will be able to parse the received message with timestamp and set X-Cache-Date header to get the cached messages from the point exactly where client needs.

If server tries to push same message more than once within cache timeout, the timestamp of the older message will be appended to message and duplicate deliveries can occur. I could not think of a way to uniquely identify the message in context of atmosphere. The message object gets cached at BroadcasterCache class and the Interceptor appends the timestamp. The message object that got cached is tranformed to some other object by the time it reaches interceptor.

This code will not work in case where the broadcast cache strategy is beforeFilter and the broadcaster filter changes the message object.

Related post on Atmosphere Framework mailing list - https://groups.google.com/forum/?fromgroups=#!topic/atmosphere-framework/A4my3qdoacc