@curl_setopt($ch, CURLOPT_HEADER, true);
- @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- @curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
+
+// These settings aren't needed. We're following the location already.
+// @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+// @curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
if (!is_null($accept_content)){
curl_setopt($ch,CURLOPT_HTTPHEADER, array (
$a->set_curl_headers($header);
@curl_close($ch);
- $stamp2 = microtime(true);
- $duration = (float)($stamp2-$stamp1);
- $a->performance["network"] += (float)$duration;
+ $a->save_timestamp($stamp1, "network");
return($body);
}}
curl_close($ch);
- $stamp2 = microtime(true);
- $duration = (float)($stamp2-$stamp1);
- $a->performance["network"] += (float)$duration;
+ $a->save_timestamp($stamp1, "network");
return($body);
}}
$i = fetch_url($scaled);
$cachefile = get_cachefile(hash("md5", $scaled));
- if ($cachefile != '')
+ if ($cachefile != '') {
+ $stamp1 = microtime(true);
file_put_contents($cachefile, $i);
+ $a->save_timestamp($stamp1, "file");
+ }
// guess mimetype from headers or filename
$type = guess_image_type($mtch[1],true);