Fixed cache problems in recommended.php, search.php, update.php.

This commit is contained in:
mike.morgan%oregonstate.edu 2006-02-21 01:02:28 +00:00
Родитель 38cb168733
Коммит e29880aa18
3 изменённых файлов: 31 добавлений и 28 удалений

Просмотреть файл

@ -7,7 +7,7 @@
* @todo make this dynamic based on an SQL field (recommended)
*/
startProcessing('recommended.tpl', $cacheId, $compileId, 'nonav');
startProcessing('recommended.tpl', 'recommended', $compileId, 'nonav');
require_once('includes.php');
// If app is not set or empty, set it to null for our switch.

Просмотреть файл

@ -12,7 +12,10 @@
* @todo fix CSS so the pull-downs look symmetrical before design freaks start crying.
*/
startProcessing('search.tpl',null,null,'nonav');
// Get our cache_id based on what we have in our query string.
$cacheId = md5($_SERVER['QUERY_STRING']);
startProcessing('search.tpl',$cacheId,$compileId,'nonav');
require_once('includes.php');
// Array to store our page information.

Просмотреть файл

@ -13,14 +13,37 @@
/**
* CHECK CACHE
*
* Check to see if we already have a matching cacheId.
* If it exists, we can pull from it and exit; and avoid recompiling.
*/
// Determine a cacheId based on params.
$cacheId = md5($_SERVER['QUERY_STRING']);
$tpl = new AMO_Smarty();
// Set our cache timeout to 1 hour.
$tpl->caching = true;
$tpl->cache_timeout = 3600;
if ($tpl->is_cached('update.tpl',$cacheId)) {
header("Content-type: text/xml");
$tpl->display('update.tpl',$cacheId);
exit;
}
/*
* VARIABLES
*
* Initialize, set up and clean variables.
*/
// Map the mysql main.type enum into the right type.
$ext_typemap = array('T' => 'theme',
'E' => 'extension',
@ -51,29 +74,6 @@ foreach ($required_vars as $var) {
}
}
// Determine a cache_id based on params.
$cache_id = $sql['os_id'] . implode('',$sql);
/**
* CHECK CACHE
*
* Check to see if we already have a matching cache_id.
* If it exists, we can pull from it and exit; and avoid recompiling.
*/
$tpl = new AMO_Smarty();
// Set our cache timeout to 1 hour.
$tpl->caching = true;
$tpl->cache_timeout = 3600;
if ($tpl->is_cached('update.tpl',$cache_id)) {
header("Content-type: text/xml");
$tpl->display('update.tpl',$cache_id);
exit;
}
// If we have all of our data, clean it up for our queries.
@ -160,7 +160,7 @@ if (empty($errors)) {
*/
if ($debug!=true) {
header("Content-type: text/xml");
$tpl->display('update.tpl',$cache_id);
$tpl->display('update.tpl',$cacheId);
exit;
}