Lock Backend Operation

How exactly does this work or how do we know if it’s working? The reason I ask is because the table cscart_lock_keys has no activity at all.

Hi!

First of all make sure that lock_backend is set to database, not dummy. Lock is only takes place when cache is cleared and need to be generated. It prevents race condition for cache generation and works in the following cases:

  1. When several visitors open the same pages simultaneously.
  2. Different pages opened by several visitors simultaneously, use the same blocks.
  3. The compiled CSS file was not generated yet and several visitors opens any storefront page.
  4. The file with compiled JS scripts was not generated yet and several visitors opens any storefront page.

All those locks should not take significant time, so most possibly you will not be able to find any lock entries there.

1 Like

Yes, I have it configured correctly. So basically I would not see any activity in the lock table unless I had a heavily visited site?

Yes, you are correct. When there are a plenty of visitors and you have recently cleared the cache of your installation.

Should redis be used for Lock backend and session_backend , while for cache_backend - apcu ?

Redis is supported for all the mentioned backends. How to set them up, is up to you :slight_smile:

I need the highest speed as I have plenty of RAM, I’m not sure if my setup is right. I also read some webkul material about Enabling Caching for API Responses using predis package.

You can try different configurations. The one that works best for you is the one you can use on a regular basis.

Whats with the API Responses , it does something extra beside simple enabling redis ?

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.

Could you please clarify, what do you mean by:

?