This will allow pages to skip loading data from backends like the database or the wallet RPC server. If a cached page is detected and valid, all dynamic content generation will be skipped completely. Other pages that have not been adjusted in this commit will still fetch backend data all the time. This will ensure clients always see the most recent data, like worker information or account changes. This should fix #309 completely but needs some testing.
24 lines
685 B
PHP
24 lines
685 B
PHP
<?php
|
|
|
|
// Make sure we are called from index.php
|
|
if (!defined('SECURITY')) die('Hacking attempt');
|
|
if (!$user->isAuthenticated()) header("Location: index.php?page=home");
|
|
|
|
// Grab the last blocks found
|
|
if (!$smarty->isCached('master.tpl', md5(serialize($_REQUEST)))) {
|
|
$debug->append('No cached version available, fetching from backend', 3);
|
|
// Grab the last blocks found
|
|
$iLimit = 20;
|
|
$aBlocksFoundData = $statistics->getBlocksFound($iLimit);
|
|
|
|
// Propagate content our template
|
|
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);
|
|
$smarty->assign("BLOCKLIMIT", $iLimit);
|
|
|
|
} else {
|
|
$debug->append('Using cached page', 3);
|
|
}
|
|
|
|
$smarty->assign("CONTENT", "default.tpl");
|
|
?>
|