Hi peeps, hoping someone can help out.
I have a snippet named installatron. and call it with [!installatron!]
the snitppet contains
<?php
$data = file('http://au1.netgss.com/optic');
natcasesort($data);
foreach($data as $element)
{
$element = trim($element);
$pieces = explode("|", $element);
$output = "<table width=\"570\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"brdrdashed\">";
$output .= "<tr>";
$output .= "<td width=\"358\" valign=\"top\"><h2>{$pieces[0]}</h2>";
$output .= $pieces[12];
$output .= "<br><br><strong>From the Author</strong><br>{$pieces[13]}</td>";
$output .= "<td width=\"212\" valign=\"top\"><img src=\"http://installatron.com/script_images/{$pieces[10]}_button.gif\"><br>";
$output .= "Script: <strong>{$pieces[0]}</strong><br>";
$output .= "Website: <a href=\"{$pieces[1]}\" target=\"_blank\">{$pieces[0]}</a><br>";
$output .= "Version: <strong>{$pieces[2]}</strong><br>";
$output .= "Type: <strong>{$pieces[3]}</strong><br>";
$output .= "Category: <strong>{$pieces[4]}</strong><br>";
$output .= "Installer ID: <strong>{$pieces[10]}</strong><br></td>";
$output .= "</tr></table><br>";
echo $output;
}
$start = microtime();
for ($i = 0; $i < 10000; ++$i)
$n = getdate(time());
$end = microtime();
list($s0, $s1) = explode(' ', $start);
list($e0, $e1) = explode(' ', $end);
echo sprintf('<hr>This page took %.2f seconds to generate',
($e0+$e1)-($s0+$s1));
?>
it takes about a minute or so to display. if i remove the <img src=\"
http://installatron.com/script_images/{$pieces[10]}_button.gif\"> call to the remotely hosted image it works instantly.
Ive tried disabling cache on snippet and on the doc. to no avail.
If i load the whole php code outside of modx it loads perfectly quick. but as soon as modx trys to get involved it takes about a minute to spit out the rendered page.