贴心猫:http采集远程数据,增加缓存功能; (在下一版本v4.4提现)
comHttp::setCache(30); // 缓存30分钟
$url = "http://imcat.txjia.com/chn.php?news-n1012";
$data = comHttp::curlCrawl($url);
$url = "http://imcat.txjia.com/chn.php?news-n1014";
$data = comHttp::socketCrawl($url);
$url = "http://imcat.txjia.com/chn.php?news-n1022";
$data = comHttp::fileCrawl($url);
$url = 'https://www.baidu.com/s?ie=utf-8&f=8&wd=php';
comHttp::doGet($url);
$url = 'https://linzhi.haofang.net/sale/a2467-b27128-c2-e3-f2/';
comHttp::doGet($url);
$url = 'http://auto.08cms.com/index.php?caid=1&ccid1=167&addno=2&jiebei=12&searchword=%B6%AB';
comHttp::doGet($url);
采集初始调试阶段;总要不断的修改代码,调试... 如果不缓存,每次刷新调试,都要等待获取远程数据,明显卡一下; 而且有些站,因为不断采集被封ip(如fang.com)[我就确实遇到过]
有些接口,限制调用频率(如好房通,限制3min调用一次) 你每次修改代码调试,难道要等3min???