Configure REDIS Cache
5
REDIS is an in-memory key-value store which can be used to hold the Shopware cache. REDIS is available via Symfony.
Dependency
Install the following REDIS package:
composer require predis/predis
REDIS CACHE
To set up REDIS for the cache, add this to the config/packages/framework.yaml file:
framework:
cache:
app: cache.adapter.redis
system: cache.adapter.redis
default_redis_provider: "redis://%env(REDIS_CACHE_HOST)%:%env(REDIS_CACHE_PORT)%/%env(REDIS_CACHE_DATABASE)%"
In your .env file add the following lines:
REDIS_CACHE_HOST="localhost"
REDIS_CACHE_PORT="6379"
REDIS_CACHE_DATABASE="0"
Where the REDIS_CACHE_DATABASE value corresponds to the database one wishes to use.
REDIS Commands
REDIS commands to check available databases:
# Total number of databases:
redis-cli CONFIG GET databases
# Currently used databases. Databases listed are taken:
redis-cli INFO keyspace
# Monitor REDIS activity:
redis-cli monitor
# Test REDIS connection. Result must be PONG:
redis-cli ping
There are no comments yet
Be the first one to comment