Comments (3)
exact same issue. any ideas?
from firebase-php.
Hello, I have not made any improvements to my pho code but I still have a delay with regards to the library that needs to be solved. In javascript the updates are so fast that they seem to be instantaneous php should behave the same way or close to that rs
from firebase-php.
@ivent @selimonline I had some very slow initial & consecutive requests ( 5-7 seconds per request ) and the changes below are how I resolved them. Also while debugging you can use curl_setopt($this->_ch, CURLOPT_VERBOSE, true);
to see where it's hanging.
My getCurlHandler has the following added lines :
+ curl_setopt($this->_ch, CURLOPT_HTTPGET, true); // <-- to reset CURLOPT_POSTFIELDS
curl_setopt($this->_ch, CURLOPT_URL, $url);
curl_setopt($this->_ch, CURLOPT_TIMEOUT, $this->_timeout);
curl_setopt($this->_ch, CURLOPT_CONNECTTIMEOUT, $this->_timeout);
+ curl_setopt($this->_ch, CURLOPT_SSL_VERIFYPEER, false); // <-- set to false to speed up SSL connections ; do at your own risk
curl_setopt($this->_ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, true);
+ // curl_setopt($this->_ch, CURLOPT_VERBOSE, true); // <-- for debugging, turn off after you're done
curl_setopt($this->_ch, CURLOPT_CUSTOMREQUEST, $mode);
+ curl_setopt($this->_ch, CURLOPT_HTTPHEADER, []); // <-- reset headers when switching from write to read
+ curl_setopt($this->_ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); // <-- force ipv4, helps with servers that have ipv6 dns lookups misconfigured
@ktamas77 you might want to consider some of these. I think it's mainly the ipv6 lookups on servers that don't support ipv6 that are slowing down Curl; as it tries to look up the host with ipv6 and then falls back on ipv4 after it fails. Might want to have an option for this, similar to the SSL option in a recent version. Related SO : https://stackoverflow.com/a/26568867/10728554
from firebase-php.
Related Issues (20)
- How to set the app or version
- how to set name in push?
- Push Parameters HOT 1
- FirebaseLib HOT 1
- Git push is removing firebase_php folder. HOT 1
- Firestore Usage HOT 1
- Cannot use Database and Auth together HOT 1
- Slow query HOT 8
- firebase connection in php HOT 1
- Firebase created a new authentication HOT 2
- how to authenticate user using email and password
- i got "Permission denied" error
- firebase query "equalTo" doesn't work with "+" symbol HOT 1
- Setting value to 0 (number) is not possible HOT 1
- Credentials provided by firebase HOT 1
- No logging in firebaseLib
- I got 3 arduino devices with same code with same php code using this Lib but in firebase it only update 1 data not simultaneously those 3 devices it requires other device to be turn off so it can be updated HOT 5
- Getting unexpected error code 0/null/100
- Composer with php7.3 first time install issue: HOT 1
- Requirements? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-php.