0

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?

DomingoSL
  • 365
  • 1
  • 4
  • 13

1 Answers1

2

In this situation, the results would be stored in RAM for the duration of the script. No cleanup is necessary.

ceejayoz
  • 32,910
  • 7
  • 82
  • 106