CodePudding user response:
Help me byCodePudding user response:
It also depends on your business needsIf each send a request, the front desk all want to know the status, it can only be at the front desk to send
If front desk just send a request, no matter what the background operation, only need to know the background last execution as a result, the background, he
Purely in terms of efficiency, in either case, you are to send ten times background, so if business needs to allow, try to avoid the front desk requests the number of times
CodePudding user response:
Why not just the front a HTTP requestCodePudding user response:
Front-end do... don't know what your business, why do you want to write a setinterval cycle request... front-end jsCodePudding user response:
Please say specific application scenarios,analyzing the specific issuesYou must first meet the requirements, then consider performance
Can tell from the performance, batch natural batch, if the client server support http2.0 is doesn't matter
CodePudding user response:
No scene, there is no basisCodePudding user response:
Must be backstage to do ah, don't you want to expose you to request routing outCodePudding user response:
Look at their business, in the actual business;The efficiency is normal, on the server will be better,
CodePudding user response:
Real-time access to other users to send to the background of news, I wrote a timer is on the front end, 30 seconds to send a request to the background, see if there are any new messages,But always feel this way is not very good,
Your great god is how to deal with this kind of situation,
In addition, testing the validity of a user Session, if the invalid is prompted to logout, also need to continuously to the backend sends a request for the Session state?
CodePudding user response:
On the backend is reliableCodePudding user response:
The back-end cycle is betterCodePudding user response:
Put the background, the front desk each request the background has a waiting TTFB time, if the circulation background, this time, performance is not appropriate, if in the background, is requests the background only once,CodePudding user response:
Backend is good, front circulation sends a request, order not sure, connection is not stable, slow,Front end is actually do show, do business to do in the back-end,