|
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 |
lastexile Smarty Rookie
Joined: 03 Jan 2008 Posts: 15
|
Posted: Fri Sep 19, 2008 8:26 am Post subject: Does SMARTY cache mySQL queries? It doesnt seem to on site |
|
|
I am running SMARTY on my site and was using Xdebug to check the speed and performance. I notice it is still doing MySQL queries. Why is that? I have:
$smarty->force_compile = false;
$smarty->caching = 2; //
$smarty->cache_lifetime = 33600;
I thought SMARTY outputs HTML cache and just grabs HTML content.
[/img]
Last edited by lastexile on Fri Sep 19, 2008 9:32 am; edited 1 time in total |
|
Back to top |
|
reb Smarty Rookie
Joined: 17 Aug 2005 Posts: 23
|
Posted: Fri Sep 19, 2008 8:59 am Post subject: |
|
|
You should also have, in your PHP file, something like :
Code: |
if (!$smarty->is_cached('index.tpl')) {
// Your SQL queries
}
$smarty->display('index.tpl');
|
Last edited by reb on Wed May 05, 2010 10:34 pm; edited 1 time in total |
|
Back to top |
|
lastexile Smarty Rookie
Joined: 03 Jan 2008 Posts: 15
|
Posted: Fri Sep 19, 2008 9:32 am Post subject: |
|
|
AHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I think that might be why. Let me do research and check!!
Thanks so much!
reb wrote: | You should also have, in your PHP file, something like :
Code: |
if (!$smarty->is_cached('index.tpl')) {
// Your SQL queries
}
$smarty->display('index.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
|