Is it possible to apply push technology?

5

I have a system, in which it displays database files, in list form.

I query the database every 5 seconds to see if there are new files, and if it has it shown to the user, using AJAX.

Why this? To avoid updating the page at all times, to see if you have any new files.

I was advised not to do this because if you have 100 users online, every 5 seconds 100 queries are done on the server.

I've been told about push technology, and here's my question, how to implement this technology?

    
asked by anonymous 08.09.2014 / 20:57

2 answers

1

When you need to keep the client synchronized with the server making AJAX requests may not be the best option, the best option we have is to use sockets in that unlike the common request from client to server the server can also" call "the client to say something happened.

You can make sockets with PHP that in this case would be WebSockets, unfortunately I do not know any quality content in Portuguese that addresses this, but if you want, you can access this github project that shows a WebSockets project with PHP link , the detail is that for this you will need access to the terminal server linux (SSH)

    
17.12.2014 / 12:06
-1

This image represents the difference well:

    
28.12.2014 / 05:01