Jump to content

How to set right cache system?


Recommended Posts

Hello All,

 

I have one issue with prestashop 1.6.0.9. cache.

 

I discovered that almost 80% of my products are not working (page is not loading just blank page) and that number was still higher and higher. (I have thousends of products)

 

Then I deleted contents of folders:

cache/smarty/cache

and

cache/smarty/compile

 

I checked that most importanat folder to clear is cache/smarty/cache/blocktopmenu/

 

It helped and all worked right, but after time, all content of these folders was back and products did not work again.

 

 

My question:

How to set cache system right, to turn off automatical generating of cache files in those folders above?

And is it ok to turn it off - or what for are these files/folder important?

 

 

Thanks in advance

Edited by croc (see edit history)
Link to comment
Share on other sites

Is your server generating any error messages to the log files?

Hi Dh42, thanks for reply,

I checked, but I found no errors about cache or any which would be important for this issue.

 

I just discovered that after manual clearing of folders cache/smarty/cache and cache/smarty/compile their content was directly generated again in a while, so the problem with products pages nonloading was cyclic.

 

In BO in preferences/performance/smarty  i changed cache button to NO, and it seems that if helped coz links are working good.

 

Was this step OK?

How about compile settings in BO, which should i choose?

 

 

Thanks

Link to comment
Share on other sites

Just a guess but ...

 

Smarty creates sub directory's recursively by default, you may not have set write permissions to enable that. For example permissions/chmod to /cache/ directory recursively to 777.

 

Alternatively you can turn off sub directory creation in config/smarty.config.inc.php

 

Change:

 

global $smarty;
$smarty = new Smarty();
$smarty->setCompileDir(_PS_CACHE_DIR_.'smarty/compile');
$smarty->setCacheDir(_PS_CACHE_DIR_.'smarty/cache');
if (!Tools::getSafeModeStatus())
$smarty->use_sub_dirs = true;
 
The last word true to false.
Edited by Bill Dalton (see edit history)
Link to comment
Share on other sites

Do not turn off auto compile and cache. All I'm talking about is write permissions in sub directory's.

 

It means that cache button in BO preferences/performance/smarty should be set as YES?

 

and just change permisions to 777 + change true to false ? Am I right?

 

Thanks in advance

Link to comment
Share on other sites

  • 3 weeks later...

Yes, keep that on.

 

I made two suggestions in my post #4. Both require working with the files/directory, not BO.

 

 

Hi Bill,

 

so when i will it change to false, what will I reach?

Will it stop to generate subdirectories in cahe and compile?

 

 

I need any tip how to stop to generate them cause my server is still falling down after it reach files quota limit.

 

In BO i turned cache button to NO, and cache folder is still empty (what for are those all folders and files?, are they important? ) now, just compile folder still generates folder and files....

 

Thanks

Link to comment
Share on other sites

×
×
  • Create New...