superisc Posted February 9, 2010 Share Posted February 9, 2010 Hi,(I'm from Spain, sorry about my bad English)As you now, there is many problems with the cache system on prestahop, which makes it slow. You can modify the file: smarty.config.inc.php like this: $smarty->caching = false; $smarty->force_compile = false; This makes that force compile is off, so the page is not regenerated every time. Doing this I get load times of 0.8-1.2 secs, and if I put it true I get 4-6 secs loading, so it's very important to put it off when you use your shop online.the other var: $smarty->caching = false if you put it to true, you activate your cache, and on my test site I get loadings of 0.2 secs, which are very good. The problem is that it actually doesn't work:As prestashop doesn't pass the ID to the smarty cache, the first category you visit, you will get the same page for every category page, and a similar thing with products and so on...You can solve it doing this: On category.php look for (line 81 on my file): $smarty->display(_PS_THEME_DIR_.'category.tpl'); And change to this: $smarty->display(_PS_THEME_DIR_.'category.tpl',$category->id); And the same with products.php and others...The problem is that as I'm not an expert, I can't know the possible errors of doing this, and the real advantages.That's why I would like other people to help me doing this test and giving your opinion.Thanks for all Link to comment Share on other sites More sharing options...
max1960 Posted February 9, 2010 Share Posted February 9, 2010 very interesting, but I can not help you, if anyone has suggestions face forward, then we test.Sorry for my english, I have used Google translate.Thanks Link to comment Share on other sites More sharing options...
chow Posted April 22, 2010 Share Posted April 22, 2010 Interesting finding. I came to this thread in search of cache knowledge in PS. I didn't know the smarty.config.inc.php file has so much funs. Have you encountered any problem so far? Link to comment Share on other sites More sharing options...
anson.c Posted May 14, 2010 Share Posted May 14, 2010 I too hope someone can help this problem since it's not a good idea to edit each of the php files. Turning the smarty cache on does improve the speed alot!!! Link to comment Share on other sites More sharing options...
gemmo Posted June 8, 2010 Share Posted June 8, 2010 Really good advise. Is there any instructions in the packages downloaded that one should put "force_compile" to false when into production mode? Its an amazing difference now. Thx. Link to comment Share on other sites More sharing options...
aopon Posted June 20, 2010 Share Posted June 20, 2010 Hi,There is also a need to check if the template is cached, otherwise prestashop does all the normal data transformations, including database queries and finally pulls data from cache. We only save time for generating html. We have to edit all the php scripts that display data and add something like this befere any actions happen:product.php if(!$smarty->is_cached(_PS_THEME_DIR_.'product.tpl',$id_product)) { $product = new Product($id_product, true, intval($cookie->id_lang)); ... ... } ... $smarty->display(_PS_THEME_DIR_.'product.tpl',$id_product); Link to comment Share on other sites More sharing options...
summer Posted July 15, 2010 Share Posted July 15, 2010 I turned off the force compile and the result is okay but some features are miss function, like thick box and product tooltips Link to comment Share on other sites More sharing options...
vincents Posted July 23, 2010 Share Posted July 23, 2010 I have exactly the same problem, the website shows only the first cached item, for category and product page, is there anyone has a good solutions to this? Link to comment Share on other sites More sharing options...
Jero Posted September 28, 2010 Share Posted September 28, 2010 Same problem on my webpage. I realy need this feature because my webpage is runing realy slow. Link to comment Share on other sites More sharing options...
Jero Posted August 12, 2011 Share Posted August 12, 2011 This issue seeems to be fixed in 1.4.4. Link to comment Share on other sites More sharing options...
masterperoo Posted January 2, 2013 Share Posted January 2, 2013 This issue seeems to be fixed in 1.4.4. I disagree - I am on 1.4.8.2 and this is still the problem. Very frustrating that I cannot find an answer. What I really don't understand, though, is why the PrestaShop team is releasing a product (smarty caching) that is obviously malfunctioning .. WHY release a broken product?? No one should have to make hacks to core code to force smarty cache to get the most recent page data. Core code hacking on a fresh install is absurd. I AGREE! It is absurd to correct fundamental core functions in order for cache to work! I am very disappointed in presta cache to date. It is not caching anything. Category pages take 8 seconds to load! ANd all this happens with something as fundamental as performance. There is a few Prestas out there with brilliant performance. Did they all have to hack core ? Link to comment Share on other sites More sharing options...
Recommended Posts