$cacheFile = 'cache.jpg';
header("Content-type: image/jpeg");
if (!(file_exists($cacheFile)) or (time() - filemtime($filename) > 60 * 5)) {
$src = file_get_contents('http://sktu.customs.ru/webcam/scrin/scrin.jpg');
echo $src;
//fastcgi_finish_request();
file_put_contents($cacheFile, $src);
} else {
readfile($cacheFile);
}