I think of two ways:
1. Take the data from the most recent period of time, if any, return the data, but this time period is not good set, chrome can use the last 3 seconds, and Firefox is the last 5 seconds, take 3 seconds, Firefox is often not available, take 5 seconds, Chrome will appear to remove duplicate data.
2. The second idea is whether the database to mark is read, but because different browsers, different terminal data is not synchronized, one of the data is identified as read, the other browser will not get the data.
So, what should be done?
Reply content:
I think of two ways:
1. Take the data from the most recent period of time, if any, return the data, but this time period is not good set, chrome can use the last 3 seconds, and Firefox is the last 5 seconds, take 3 seconds, Firefox is often not available, take 5 seconds, Chrome will appear to remove duplicate data.
2. The second idea is whether the database to mark is read, but because different browsers, different terminal data is not synchronized, one of the data is identified as read, the other browser will not get the data.
So, what should be done?
The second way of thinking can, but to optimize, can be in the table memory data update time, in the terminal storage from the server to get the latest data update time, the terminal time is smaller than the table time, it represents the new data to push.