daydreamer Posted October 16, 2008 Share Posted October 16, 2008 I am using cURL to visit/download pages on my server. I was just thinking about the most effective and fastest way to write my code. Wouldn't it be quicker to write: curl_setopt($curl, CURLOPT_URL, 'http://66.102.9.99'); than: curl_setopt($curl, CURLOPT_URL, 'http://www.google.co.uk'); because cURL wont have to go to a DNS and resolve google.co.uk to 66.102.9.99? Link to comment https://forums.phpfreaks.com/topic/128765-curl-using-ips-vs-domains-fastest/ Share on other sites More sharing options...
DarkWater Posted October 16, 2008 Share Posted October 16, 2008 I'd use the domain name because just in case a site changes IPs, you wouldn't need to go around fixing everything. DNS isn't that slow. Link to comment https://forums.phpfreaks.com/topic/128765-curl-using-ips-vs-domains-fastest/#findComment-667429 Share on other sites More sharing options...
daydreamer Posted October 16, 2008 Author Share Posted October 16, 2008 true, but it would still be faster even if by only milliseconds wouldn't it? Dont major websites have static IP's though because its better for search engine optimization? Link to comment https://forums.phpfreaks.com/topic/128765-curl-using-ips-vs-domains-fastest/#findComment-667472 Share on other sites More sharing options...
DarkWater Posted October 16, 2008 Share Posted October 16, 2008 true, but it would still be faster even if by only milliseconds wouldn't it? Dont major websites have static IP's though because its better for search engine optimization? I mean, most sites have static IPs, but you never know. What does the millisecond difference matter? I don't even think you'd be able to measure the speed change accurately. >_> Link to comment https://forums.phpfreaks.com/topic/128765-curl-using-ips-vs-domains-fastest/#findComment-667474 Share on other sites More sharing options...
daydreamer Posted October 16, 2008 Author Share Posted October 16, 2008 just for that little bit extra performance. Link to comment https://forums.phpfreaks.com/topic/128765-curl-using-ips-vs-domains-fastest/#findComment-667481 Share on other sites More sharing options...
DarkWater Posted October 16, 2008 Share Posted October 16, 2008 just for that little bit extra performance. There's MUCH better places to focus your optimization goals on. I'd suggest making sure everything else is completely optimal before you worry about DNS. Link to comment https://forums.phpfreaks.com/topic/128765-curl-using-ips-vs-domains-fastest/#findComment-667487 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.