Jump to content

Fastest method of "getting contents" of external url?


Attilitus

Recommended Posts

Part of my licensing script requires that I access an external URL while passing parameters (which are included in the url as ?parameter=parametervalue, ect.)

 

I have been simply using the file() command, but it takes at the very least a good second to access it, which is simply too much time. It is a delay that occurs regardless of the external server speed. Could anyone suggest some faster lightweight methods of getting the contents of an external parameter'D url?

Link to comment
Share on other sites

You're going to have a delay, no matter what. You shouldn't fetch a file from another server for each page load. At least cache a copy of it on a daily/hourly/etc basis.

 

Something that might make it slightly faster is to use the IP, if it's not on a shared host. That way you aren't waiting on the DNS server.

Link to comment
Share on other sites

Yea. :/

 

I guess a caching system is in order, still how much time could an IP lookup rather than DNS save? What is typically the fastest format for external data fetching? I notice that a TXT file externally parses far faster than than a php script, perhaps an external caching system would be optimum.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.