 |
? |
Author |
Message |
siemprelisto
Joined: 15 Mar 2005
Posts: 4
|
Posted: Tue Mar 15, 2005 5:59 am |

|
Have everything set up using a SSI into a Template within an existing web page...works Great! I would like to have the RSS Feed cached for several reasons. First, less calls on the feed provider, reduce bandwidth, with RSS cache our pages will load quicker if there is no new content. One of the other scripts I tried had this already included and it worked nice but the overall script was not as nice nor does not compare to rss2html
I have made several direct inquires with no response...will someone Help??
Thanks & Best Regards!
|
|
|

|
 |
Tech Support
Joined: 27 Aug 2004
Posts: 563
|
Posted: Tue Mar 15, 2005 4:14 pm |

|
Is it that you want your RSS feed file cached (the .xml file)
or
the webpage generated from the feed (using rss2html.php) cached?
|
_________________
FeedForAll Support
|
|

|
 |
siemprelisto
Joined: 15 Mar 2005
Posts: 4
|
Posted: Tue Mar 15, 2005 5:04 pm |

|
I just want the Feed file cached, not the entire page. This way rss2html.php would look in the file I named rss_cache first prior to making a call on the feed provider.
This is an example from one of the other scripts I have tried.
// parameters used for caching
$use_cache=true;
$cache_folder="rss_cache";
$cache_valid=60; // minutes
$display_channel_name=false; // set to false to hide channel name & link
$channel[]=array("","","","","","");
// ***********************************
You can turn cache on or off with, $use_cache=true; or $use_cache=false;
You can set the refresh time for the cached file, in minutes.
function getrss($url) {
global $channel,$items;
global $use_cache,$cache_folder,$cache_valid;
if($use_cache) {
$cache_filename=$cache_folder."/".md5($url).".rss";
if(file_exists($cache_filename)) {
$t=filemtime($cache_filename);
$cache_create=((!$t)||($t
else
$cache_create=true;
if($cache_create) {
//cache not valid - create it again
$simple = file($url);
$f=fopen($cache_filename,"w");
for($i=0;$i
fwrite($f,$simple[$i]);
fclose($f);
$simple=implode('',$simple);
}
else
$simple = implode('',file($cache_filename));
}
else
$simple = implode('',file($url));
I would like rss2html.php to run Just like it does now, with the exception of checking the rss_cache file prior to calling on the rss feed provider.
Thanks for your help!
|
|
|

|
 |
Tech Support
Joined: 27 Aug 2004
Posts: 563
|
Posted: Tue Mar 15, 2005 10:43 pm |

|
I have added caching to the feature request list for future versions of the rss2html.php script.
I will post again if I can find out more info about if/when it will be available.
|
_________________
FeedForAll Support
|
|

|
 |
siemprelisto
Joined: 15 Mar 2005
Posts: 4
|
Posted: Wed Mar 16, 2005 4:17 pm |

|
Thank you for your attention and response to my question. Maybe someone viewing this post will know how to tweak the script above to have it work with rss2html.php?? I look forward to having this feature included...hope it's soon. Again, Thanks for the response and for the Great product!!
|
|
|

|
 |
siemprelisto
Joined: 15 Mar 2005
Posts: 4
|
Posted: Tue Aug 09, 2005 7:32 pm |

|
What is the status of adding caching?
Thank You!
|
|
|

|
 |
JedOi
Joined: 25 Jul 2005
Posts: 19
|
Posted: Wed Aug 10, 2005 1:36 am |

|
You could try setting up a cron job or (if you don't have cron jobs) use Pseudo-Cron ( http://www.bitfolge.de/pseudocron-en.html ) to run this simple script however often you require the local cache to be updated ...
$feed = 'http://today.reuters.com/rss/topNews';
$cache = 'Local.XML';
if (!copy($feed, $cache)) {
echo "failed to copy $file...\n";
}
?>
Change feed & local filename as you wish.
|
|
|

|
 |
|
|
|