1

Reading the Magento 2 documentation is a little bit confusing.

Should I use the suffix :hash or :version?

If you visit https://devdocs.magento.com/guides/v2.4/config-guide/redis/redis-pg-cache.html#redis-preload-feature

When using the preload feature with the L2 cache, add the ‘:hash’ suffix to your keys:

'preload_keys' => [
    '061_EAV_ENTITY_TYPES:hash',
    '061_GLOBAL_PLUGIN_LIST:hash',
    '061_DB_IS_UP_TO_DATE:hash',
    '061_SYSTEM_DEFAULT:hash',
],

If you visit https://devdocs.magento.com/guides/v2.4/config-guide/cache/two-level-cache.html

We also recommend the use of the cache preload feature, as it will drastically decrease the pressure on Redis. Do not forget to add suffix ‘:version’ for preload keys.

1
  • Devdocs was updated to have proper suffix
    – KAndy
    Nov 15, 2021 at 18:26

1 Answer 1

0

If you use Redis adapter, then you need to specify keys in format: {cache_prefix}{key_name}

If you use L2 adapter, then you need to specify keys in format as it load only hashes from Redis and data from local storage (if present): {cache_prefix}{key_name}:hash

see: https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php#L47

2
  • 1
    how do i know if i use L2 adapter?
    – Pako
    Oct 3, 2022 at 9:59
  • @KAndy How can I add this configuration in the Magento cloud env.php file? Oct 6, 2022 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.