Skip to main content
Version: 3.x

Caching customer data

Learn how to cache your customer's data.

How to enable customer caching

To enable customer caching, you need to set the environment variable FRONT_COMMERCE_CURRENT_CUSTOMER_CACHE_ENABLE to true.

FRONT_COMMERCE_CURRENT_CUSTOMER_CACHE_ENABLE=true

Customer will be cached as soon as a call is made to the customer query. The TTL for the cache is 5 minutes.

info

Please note that the customer cache functionality is only available for authenticated customers.

If your Front-Commerce application is configured to use multiple stores, the customer cache is scoped to the current store.

EG:

  • You have a default store and a second store named FR.
  • The customer is connected to the default store.
  • Its data will be cached.
  • The customer switches to the FR store, the data cached from the default store won't be available for the FR store.