Configure caching strategies
Caching dataLoaders data
By default, all dataLoaders use a per-request in-memory caching strategy. This means that within the same GraphQL query, the same data is requested only once.
Front-Commerce is also shipped with a persistent cache implementation, using a Redis strategy (see Caching strategies). You can implement new strategies to support more services (we also can help and support more strategies, please contact us).
The cache is configured using the
cache key in your
Front-Commerce configuration. In our default skeleton, this configuration is
managed through the app/config/caching.js
file for easier maintenance.
Caching strategies
This section provides details about the available strategy implementations in
Front-Commerce. They can be used by using them in the implementation
key of
your caching strategies configuration.
Redis
See how the Redis strategy is configured here.
Magento 1 specific strategies
See how the Magento 1 specific strategies are configured here.
Magento 2 specific strategies
See how the Magento 2 specific strategies are configured here.
Advanced usage
If you need additional implementations or want to leverage strategies for a specific use case, please contact us so we can discuss it and guide you!