|
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 |
till Smarty Rookie
Joined: 25 Feb 2004 Posts: 19 Location: Berlin, Germany
|
Posted: Mon Aug 16, 2004 7:05 pm Post subject: v2.6.3, is_cached(), cache ID not accepted |
|
|
[php:1:f46f36092d]<?php
if(!$smarty->is_cached('archiv-threads.tpl', md5($_SERVER['QUERY_STRING']))){
...
}
$smarty->display(archiv-threads.tpl');
?>[/php:1:f46f36092d]
I thought this up to generate the IDs on the fly since I do have a lot lot different pages that get generated from this template. The QUERY_STRING is always unique, and for ease of use I wrapped it in md5().
I echo'ed them on the page and they actually do change. But the cached of the "first" page is always displayed.
Did I miss something?
Till |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Aug 16, 2004 7:11 pm Post subject: Re: v2.6.3, is_cached(), cache ID not accepted |
|
|
till wrote: | Did I miss something? |
yes, you have to pass the cache_id to display() also:
[php:1:802312687a]<?php
if(!$smarty->is_cached('archiv-threads.tpl', md5($_SERVER['QUERY_STRING']))){
...
}
$smarty->display('archiv-threads.tpl', md5($_SERVER['QUERY_STRING']));
?>
[/php:1:802312687a]
and then maybe store the cache_id in a variable, to save one call to (the computionally expensive) md5(). |
|
Back to top |
|
till Smarty Rookie
Joined: 25 Feb 2004 Posts: 19 Location: Berlin, Germany
|
Posted: Tue Aug 17, 2004 7:36 am Post subject: |
|
|
Ah, sorry. I feel very stupid. |
|
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
|