PHP API without too much traffic

110
November 28, 2019, at 7:20 PM

For an App we are building an API, right now It works that the Client(Android) send a request every 2 seconds to check for updates. But maybe there is a way so we dont have a lot of requests every 2 seconds? Im asking because I am not very experienced in PHP.

Answer 1

What you are looking for is a websocket connection. It is, basicaly, a steady two way connection for your front-end and your backend. It listen to event and react to them.

I don't know any librairy in Java ( Android ) but i'm sure you can find one with a simple google search.

As for the PHP part of things, i've tried a few librairies and never had much luck. This was quite some times ago so maybe things have changed. I know there is ratchet, but at the time, i could make it work. Our solution was to send http request to a nodeJS server, on which was running a Websocket client.

READ ALSO
Azure Password-Based SSO and Edge on iOS/Android

Azure Password-Based SSO and Edge on iOS/Android

Okay, so I'm working for a customer, setting up some Enterprise Applications in Azure (the ones that appear in the myapp(lication)s portal

89
Add text/content to PDF files (Angular)

Add text/content to PDF files (Angular)

I work on project and try to implement signature pad on pdf fileI make a signature with angular2-signaturepad package and view the pdf file with ng2-pdf-viewer

108
How to set the right Port on 'heroku local'

How to set the right Port on 'heroku local'

I am working a Node + Express server on Heroku, and when trying to force a certain port on local development, it does not applyAny help is gladly welcome !

93