pashaps Posted September 13, 2012 Share Posted September 13, 2012 Alright, so we all know there's pretty little trigger on the back-office Preferences > Performance tab. It's called "Cache" (inside the Smarty box). You have the option for Yes and No, and a cute note that says "Should be enabled except for debugging.". BUT, in Prestashop out-of-the-box file structure, /config/smarty.config.inc.php has $smarty->caching *hardcoded* to "false". If you want to try to be clever and turn it on, or even set it to use the config value (set in the back-office), you'll be rewarded with a completely broken template (in my case anyway). What's the story here, Prestashop? Link to comment Share on other sites More sharing options...
Bruno Leveque Posted September 13, 2012 Share Posted September 13, 2012 Hi, On v1.4.x, the best thing is to force compile_check to true (done automatically in v1.5.x and will very probably be too in v1.4.9.1). On the other hand, we only use the Smarty cache for the blockcategories module. Regards, Link to comment Share on other sites More sharing options...
pashaps Posted September 13, 2012 Author Share Posted September 13, 2012 So you're confirming that smarty cache is not actually used in prestashop (hence the hardcoded $smarty->caching = false)? Link to comment Share on other sites More sharing options...
Bruno Leveque Posted September 13, 2012 Share Posted September 13, 2012 So you're confirming that smarty cache is not actually used in prestashop (hence the hardcoded $smarty->caching = false)? Yep, only in "blockcategories" and the Smarty's configuration is properly re-written w/ this function in Tools.php: public static function enableCache($level = 1) { [...] if (!Configuration::get('PS_SMARTY_CACHE') || ($smarty->force_compile == 0 && $smarty->caching == $level)) return; [...] Regards, Link to comment Share on other sites More sharing options...
Dh42 Posted September 13, 2012 Share Posted September 13, 2012 I would like to add, while you are calling it a sham, 3rd party modules can be written to take advantage of it also. Some modules obliviously would break using it ie. shipping modules, payment modules, filtering modules. But it can be leveraged with sliders and other type of modules. It is not ideal, but it can be used. Link to comment Share on other sites More sharing options...
pashaps Posted September 13, 2012 Author Share Posted September 13, 2012 @Bruno: I was unaware of the enableCache function inside the Tools class. This does change things a bit. But I do think its very misleading that there is a toggle switch for smarty cache in the backoffice (and that every tutorial i've seen online says to enable it for the best performance) without documentation/explanation that it only applies to blockcategories by default . @DesignHaus42: I was asking if it was a sham, not saying it was . In any case the answer seems to be "sort of". Link to comment Share on other sites More sharing options...
mmsh Posted November 6, 2012 Share Posted November 6, 2012 (edited) hi Bruno, "the best thing is to force compile_check to true"... can you explain why the best thing and what exactly does this compile_check ? thanks maybe do you mean $smarty->caching = true; ... $smarty->compile_check = true; ??? no, it breaks the same my installation test... and well... what the benefit of $smarty->compile_check = true; only ? Edited November 6, 2012 by mmsh (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts