Вы можете использовать простой бит PHP кэшировать удаленный файл и обслуживать локальную копию.
Основываясь на этом PHP Remote File Cache примере вы могли бы сделать что-то вроде этого (непроверенные):
<?php
$url = 'ftp://username:[email protected]/folder/file.ext';
#we need to do some caching here
$cache_dir = dirname(__FILE__) . '/cache/'; // directory to store the cache
$cache_file = $cache_dir . md5($url);
$cache_time = 1 * 60 * 60; // time to cache file, # minutes * seconds
// check the cache_dir variable
if (is_dir($cache_dir) &&
is_writable($cache_dir) &&
file_exists($cache_file) &&
(time() - $cache_time) < filemtime($cache_file)) {
$data = file_get_contents($cache_file); // name of the cached file
}
else {
$data = file_get_contents($url);
file_put_contents($cache_file, $data); //go ahead and cache the file
}
// Compress output if we can.
if (function_exists('ob_gzhandler')) {
ob_start('ob_gzhandler');
}
header('Content-type: text/xml; charset=UTF-8'); // Change this as needed
// think about client side caching...
header('Cache-Control: must-revalidate');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $cache_time) . ' GMT');
echo $data;
exit;
Какой язык (PHP, .NET C#, и т.д.) /? ... и насколько большой файл? – 2010-11-23 01:38:39