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
defaultstore and a second store namedFR. - The customer is connected to the
defaultstore. - Its data will be cached.
- The customer switches to the
FRstore, the data cached from thedefaultstore won't be available for theFRstore.