PrestaShop Forums: Solving Cache problems. - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


Solving Cache problems.


Solving Cache problems.

#1 superisc

    PrestaShop Newbie

  • 26 Nov 2009
  • Members
  • Pip
  • 5 posts

Posted 09 February 2010 - 11:54 AM

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

#2

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 09 February 2010 - 02:39 PM

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

#3

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 22 April 2010 - 12:30 PM

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?

#4

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 14 May 2010 - 01:10 AM

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!!!

#5

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 08 June 2010 - 04:20 PM

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.

#6

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 20 June 2010 - 08:28 AM

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);


#7

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 15 July 2010 - 01:48 AM

I turned off the force compile and the result is okay but some features are miss function, like thick box and product tooltips

#8

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 23 July 2010 - 10:21 AM

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?

#9

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 28 September 2010 - 06:42 AM

Same problem on my webpage. I realy need this feature because my webpage is runing realy slow.

#10

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 30 January 2011 - 01:19 AM

I also have this problem with Smarty caching causing my prestashop site to display an old 'view' of a page, because the new, actual version/content/settings of the page seems to be ignored. I had to turn Smarty caching off just so that I could control which category names appeared in the sidebox on home page -- with Smarty caching on, my changes to the sidebox were ignored.

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.

#11 Jero

    PrestaShop Newbie

  • 03 Sep 2010
  • Members
  • Pip
  • 5 posts

Posted 12 August 2011 - 11:20 AM

This issue seeems to be fixed in 1.4.4.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users