Jump to content

When can I $use_cache = true in Db::getInstance()->executeS() ?


hakeryk2

Recommended Posts

Hello devs,

 

I have a question - I found out that when I changed 3rd param from false  
 

Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql, true, false); 

to true

Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql, true, true);

then my sql query was generated much more faster.
 

I was looking for answer in prestashop docs but I found information only that i should use this function "if I really know what am I doing" so ... I don't know why and when I should use $use_chache = true in queries.

 

What is defining this? What types of queries I should cache and which I shouldn't. Any help will be helpfull :)
 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...