|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ThorstenSchmidt Smarty n00b
Joined: 25 Sep 2003 Posts: 1
|
Posted: Thu Sep 25, 2003 2:26 pm Post subject: Caching doesn't seem to work |
|
|
Dear,
I have a problem with the caching function.
My Script looks like
[php:1:9b12ef7dc2]
<?php
session_start();
error_reporting(0);
require_once 'class/Smarty.class.php';
$obj_smarty = new Smarty;
if(empty($_SESSION['lang'])) {
$_SESSION['lang'] = 'de';
}
$obj_smarty->caching = true;
$obj_smarty->cache_lifetime = 18000;
if(!$obj_smarty->is_cached("right.tpl", $_SESSION['lang'])) {
// do something
// ...
// read database
}
$obj_smarty->display("{$_SESSION['lang']}/right.tpl", $_SESSION['lang']);
?>
[/php:1:9b12ef7dc2]
The cachefile is written correctly in the directory, but everytime I call the page, I have a new entry in my database log file with the query this page is calling.
So the page seems to be NOT displayed from cache.
What am I doing wrong?
Thanks for helping
Thorsten |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Sep 25, 2003 2:46 pm Post subject: Re: Caching doesn't seem to work |
|
|
ThorstenSchmidt wrote: | What am I doing wrong? |
you are testing for "right.tpl"
but display (and cache) "{$_SESSION['lang']}/right.tpl" |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|