7

I check similar question but I am unable to find command to add Redis server for full page cache.

The command to add Redis for backend cache is following:

php bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=xxxxxxxx --cache-backend-redis-db=0

I want to use Redis for Full Page Cache what would be the command to do this?

asked Apr 18, 2019 at 10:56
4
  • Please pay attention the Redis can be used only for build in FPC, that do not recommended to use in production. Commented Apr 21, 2019 at 1:30
  • Then why it is defined in devdocs? And why my website's performance is much better after applying it? Commented Apr 21, 2019 at 5:23
  • I am using Redis from AWS elasticache Commented Apr 21, 2019 at 5:24
  • Yes, please see recommendations devdocs.magento.com/guides/v2.3/performance-best-practices/… Commented Apr 23, 2019 at 20:51

1 Answer 1

6

I found the solution.

For Backend cache on Redis

use below sample command

php bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=xxxxxxxxxxx --cache-backend-redis-db=0

For Page Cache on Redis

use below sample command

php bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=xxxxxxxxxxx --page-cache-redis-db=1

Both cache could be save on same redis server but it will use different databases 0 and 1

Note: For local redis cache, use 127.0.0.1

answered Jun 28, 2019 at 4:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.