-
-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why not take advantage of Keep-Alive? #14
Comments
Yes, please. It's really bad to use Firebase in this way. |
it's relatively easy to implement, please feel free to fork the repository and send a pull request if you want to have this functionality immediately. otherwise i'll examine the best possible implementation soon. thank you for your suggestion. |
@ktamas77 Too busy with midterms 👎 Waiting for your solution :) Thank you for fast response |
Just opened a pull request that adds Keep-Alive support. Please test. Thanks. |
I added your method + fsocks multi set method. #16
Some stats (on digitalocean vps - ubuntu 12.04 )
|
Amazing speed is great and all, but I'm not sure whether it should be the job of an API client library to handle parallelization through platform-specific shell commands. Parallelization should be the job of a different library, of which PHP already has plenty. Not to mention this opens the door to all sorts of nasty security bugs. (addslashes? seriously?) The fsockopen version looks cool, though. Could you add Keep-Alive support to that? It seems wasteful to close the socket after every request. As long as you don't need to read the responses, it should be just as fast as, if not faster than, the shell_exec method. Forking a shell is kinda expensive. Anyway, just my $0.02 as the original opener of this issue. Of course @ktamas77 will have the final say. |
@kijin haha you're right :) in push request i mentioned :
What is 0.02$, i don't understand. (i'm newbie in version controlling and github. Sorry if I made mistake ) |
Haha, it's just an American idiom, "my two cents". |
firebase-php
promptly closes the curl handle after each request, making it impossible to take advantage of the underlying protocol's Keep-Alive capability. Since all Firebase API requests use SSL, using Keep-Alive would save a massive amount of time and resources (SSL handshake in addition to TCP handshake) when multiple requests are made in quick succession.Enabling Keep-Alive with PHP curl is as simple as reusing the same curl handle without closing it.
The text was updated successfully, but these errors were encountered: