I have a centOS machine using a nginx web server. In my application (php) I use cURL to get a remote file and then send it to the view:
$cache_expire = 60*60*24*365;
header("Pragma: public");
header("Cache-Control: maxage=". $cache_expire);
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $cache_expire).' GMT');
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $REMOTE-FILE-URL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$img = curl_exec($ch);
curl_close($ch);
echo $img;
I wonder, cURL needs to download the file to a tmp/cache folder somewhere in my server right? Where is this folder? Is the file deleted later or I have to clean the folder once in while?