This article discribes an easy way to cache data received from other websites in order to improve the performance of one own's site. The method was successfully tested on alexander-kaletsch.de (blog) and birgit-kaletsch.de (kurse-detail).
Theory: Download Websource only after cache got invalid.
First you have to create a dummy template: _cache.tpl
{$cache}
The index.php:
require_once("Smarty/Smarty.class.php");
$smarty = new Smarty();
$smarty->compile_dir = "_comp/";
$smarty->template_dir = "tpl/";
$smarty->cache_dir = "_cache/";
$smarty->cache_lifetime = 60*60; // 1h$smarty->caching = 2;
if(!$smarty->is_cached("_cache.tpl", "blog")){
$smarty->assign("cache", file_get_contents("http://www.patworx.de/blog/index.php"));
}echo $smarty->fetch("_cache.tpl", "blog");
if(!$smarty->is_cached("_cache.tpl", "ak")){
$smarty->assign("cache", file_get_contents("http://www.alexander-kaletsch.de/"));
}echo $smarty->fetch("_cache.tpl", "ak");