Classic Crawl Network data method Efficiency analysis (fsockopen/curl/file_get_contents) filegetcontents Timeout js file get contents filegetcontents

Source: Internet
Author: User
Tags http post
fsocketopen/curl/file_get_contents contrast
fsocketopen is a lower-level call, a socket call that belongs to the network system

1, Fsockopen returns data that has not been processed, including the length of the data and the terminator of the data

2, can be set based on UDP or TCP protocol to interact

Curl

Curl through the packaging to support HTTPS authentication, HTTP Post/put method, cookies, etc., the function is very powerful

1, Curl returns the processed content

2, auto-cache DNS query information, the same domain name only once query performance and efficiency high

3, support get, post multiple ways request

fopen/file_get_contents

Each request will be re-made to the DNS query, and the DNS information is not cached.

is using Http_fopen_wrapper and is not keeplive.

1, low efficiency

2, only get data via get

The above describes the classic crawl network data method Efficiency analysis (fsockopen/curl/file_get_contents), including the file_get_contents aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.