How to speed up cURL in php?

后端 未结 7 1126
粉色の甜心
粉色の甜心 2020-12-31 07:38

I\'m trying to get embed tweet from Twitter. So, I\'m using cURL to get the json back. I wrote a little test but the test takes around 5 seconds as well as when I run locall

相关标签:
7条回答
  • 2020-12-31 08:39

    Try using with --ipv4 parameter.

    This will force curl to use only ipv-4 and ignore ipv-6 which is still not very compatible with some devices and slows down the process. Adding --ipv4 to my curl command reduced the cost from 8 seconds to 4 seconds. Which is %50 faster.

    0 讨论(0)
提交回复
热议问题