RE:RE caching problem
| From: | atu | Date: | Wed, 27 Feb 2002 21:04:29 +0000 |
| Subject: | RE:RE caching problem | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2881@lists.php.net to get a copy of this message | ||
Here again my code. request_uri change for different db calls, but there is one single chache file
that never change.
I work with smarty 1.5.2 under win 2000, php 4.1.1, apache 1.3.22
require("smarty/Smarty.class.php");
$smarty = new Smarty;
$smarty->caching=true;
$smarty->compile_check = true;
$smarty->debugging = false;
$GLOBALS['REQUEST_URI'];
$tpl ="index.tpl";
echo $REQUEST_URI;//--test if request changed for differnt db calls
/*
some outputs:
/phparchive.a-tu.net/index.php?link_db=1&link_lang=0&link_catid=4
/phparchive.a-tu.net/index.php?link_db=1&link_lang=0&link_catid=5
/phparchive.a-tu.net/index.php?link_db=1&link_lang=0&link_catid=6
*/
if(!$smarty->is_cached($tpl,$REQUEST_URI)){
db calls
}
$smarty->display($tpl,$REQUEST_URI);
----------------------------------------------------------------
> That means that for some reason, $REQUEST_URI is being passed in as the
> same value (probably empty!) each time.
>
> echo the value of $REQUEST_URI right before the is_cached() function
> call, see if it changes each time.
>
> atu wrote:
> >
> > No, only one cache file
> >
> > -------------------------------------------------------------------
> >
> > > Are you getting new cache files in the cache directory for each unique
> > > $REQUEST_URI?
> > >
> > > atu wrote:
> > > >
> > > > If I replace REQUEST_URI by some differnt names, the cache dosent
> change.
> > > >
> > > > ---------------------------------------------------------------------
> > > > > Are you getting a new file in the cache directory each time you
> change
> > > > > REQUEST_URI? Is the source file changing each time?
> > > > >
> > > > > Also, try hard coding and see what happens:
> > > > >
> > > > > $smarty->display($tpl,'a');
> > > > > $smarty->display($tpl,'b');
> > > > >
> > > > > see if you get two separate caches.
> > > > >
> > > > > atu wrote:
> > > > > >
> > > > > > I get the same cache file, even if the content of $REQUEST_URI
> have
> > > changed.
> > > > > > -----------------------------------------------------------------
> >
> > ---
> > You are currently subscribed to smarty as: monte@ispi.net
> > To unsubscribe send a blank email to $subst('Email.Unsub')
> > Visit Smarty's homepage at
> > http://www.phpinsider.com/php/code/Smarty/
>
> --
> Monte Ohrt <monte@ispi.net>
> Director of Technology, ispi Inc.
>
> ---
> You are currently subscribed to smarty as: smarty@a-tu.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
>
>