Can I get any examples on how to update data on page live in WordPress ? The data should get updated from database. Something like chat application - I want to implement that on a auction site where people are bidding and as soon as bid is done it should update on aution page with live data that how many bids are done. Dont want to use pgp websockets.
WordPress is not what I would use to do this. A proper application is the best idea.
I already have existing WordPress application where I need to update. Want to update a page continuously with live data from database.And do not want to use php websockets
SSE is a better alternative, since it’s not bi-directional as WebSockets and usually easier to implement.
Although for WordPress I don’t think there is a pre-made solution.
I think this uses php web sockets. So cant use it
Thanks for it :). I will check that
Can we use WordPress REST api to do that ? Anybody can suggest any links or plugins which are already available?
Yes, REST API might help you. But I would too not recommend using WordPress for this kind of task.
The problem is once the backend renders the webpage and returns it to the client The WordPress loop is over. One possible method ( and I have not tried it, but it seems it may work ) is the following:
Thanks for sharing that :). I will check that in detail. But demo does not work and not sure if this is a good idea for heavy database or sites with heavy traffic?