Hello to all.
Previous question using HTTP proxy . Now! How to save the page content? Those. cache pages and store them in a folder. Found a function in the internet:
CURLOPT_DNS_USE_GLOBAL_CACHE TRUE
to use the global DNS cache. This option is not thread safe and is enabled by default.
How to work with this function?
Still found:
By default, it’s not a bad idea.
An example of the function, maybe it does not apply, but still give.
// Определить папку для хранения кэшированных данных define ('CACHE_DIR',dirname(__FILE__).'/cache'); // Запись данных в кэш function save_cache($file, $data) { if ($f=fopen(CACHE_DIR.'/'.$file,'w')) { fwrite($f,serialize($data)); fclose($f); return true; } else { return false; } }