@Byron Whitlock
Ok, I was doing ~same thing. But I decided not to use MagPie. Instead I use rss2html.php which generates HTML code from RSS i fetch, based on HTML template I provide it with. When I say include("rss2html.php"), it generates HTML. So instead of caching RSS, I am caching this already generated HTML. This is my very simple block of code:
<?php
$hashfromURL = hash("md5",$url);
$cachefile = "cache/rss/".$hashfromURL.".html";
$cachetime = 5*60; //5 minuta TODO:Pri deployment-u povecati na sat-dva.
//Serviraj is kesha ako je mladji od $cachetime
if(file_exists($cachefile) && (time() - filemtime($cachefile) < $cachetime ))
{
include($cachefile);
echo "RSS ucitan iz kesha!";
}
else{//Ucitaj RSS ponovo
$XMLfilename = $url;
//Pocni dump buffera
ob_start();
include("rss2html.php");//HTML parsiran sadrzaj RSS-a
//Otvori kesh fajl za pisanje
$fp = fopen($cachefile, 'w');
//Sacuvaj sadrzaj izlaznog buffer-a u fajl
fwrite($fp, ob_get_contents());
//zatvori fajl
fclose($fp);
//Posalji izlaz na browser
ob_end_flush();
echo "RSS osvjezen - feed ponovo ucitan!";
}
?>