file_get_contents and curl are slow

Asked by Mike H

Hello, again. I'm retrieving XML from a website using file_get_contents and curl and both methods are pretty slow. file_get_contents takes from one to three seconds for each request and curl takes 5 or 6 times as long. I know this isn't an issue with the remote site because I can just put the url in my browser and the XML is retrieved very quickly. I suspect that I'm not configuring curl optimally but I can't imagine what's wrong with file_get_contents. Could my PHPDevShell configuration be slowing these requests down somehow?

edit: I meant file_get_contents, of course.

Question information

Language:
English Edit question
Status:
Answered
For:
PHPDevShell Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
TitanKing (titan-phpdevshell) said :
#1

Hi Mike, this is without a doubt not PHPDevShell slowing it down. You should test your speed to that specific request. PHP merely calls the retrieval directly.

Revision history for this message
Mike H (mike7496) said :
#2

Ok, thanks. The slow requests occur both locally and on the "production" server. I thought there might be some kind of development or debug setting that could hamstring them. I'll try to figure out what else might be causing this.

Can you help with this problem?

Provide an answer of your own, or ask Mike H for more information if necessary.

To post a message you must log in.