Is the chat message sent after being processed in the background or sent to the front end for processing?

Source: Internet
Author: User
The title is not clear enough. let's explain it in detail. The message that A user needs to receive. One is to determine the status on the server based on the last operation, such as whether the chat window is opened, and then send different messages according to the status. for example, if the chat window is opened, the server sends the chat information, if it is not enabled, send it... the title is not clear enough. let's explain it in detail.
The message that A user needs to receive.
One is to determine the status on the server based on the last operation, such as whether the chat window is opened, and then send different messages according to the status. for example, if the chat window is opened, the server sends the chat information, if it is not enabled, a message is sent.
The other is that the server sends A message. after receiving the message, user A uses JS to determine whether the window is opened and then selects whether to display or prompt.

I think the first method is more controllable for information, and the server computer is better than the user end, which can ensure information integrity. However, if an error occurs in status retrieval, it will be messy.
The second method is easy to write, but the user experience is not very good. after all, we need to perform logic processing.

The server-side code is written on the basis of wokerman. it should be less relevant to this issue.

Or is there another better way? I hope that our predecessors will not be enlightened. Thank you.

Reply content:

The title is not clear enough. let's explain it in detail.
The message that A user needs to receive.
One is to determine the status on the server based on the last operation, such as whether the chat window is opened, and then send different messages according to the status. for example, if the chat window is opened, the server sends the chat information, if it is not enabled, a message is sent.
The other is that the server sends A message. after receiving the message, user A uses JS to determine whether the window is opened and then selects whether to display or prompt.

I think the first method is more controllable for information, and the server computer is better than the user end, which can ensure information integrity. However, if an error occurs in status retrieval, it will be messy.
The second method is easy to write, but the user experience is not very good. after all, we need to perform logic processing.

The server-side code is written on the basis of wokerman. it should be less relevant to this issue.

Or is there another better way? I hope that our predecessors will not be enlightened. Thank you.

The original message is sent to the front end for processing, which does not affect the user experience.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.