How to make your NextCloud faster with Redis as an in-memory cache using Docker?

I’m obsessed with optimizing things. Already I’ve optimized my VPS in a few different aspects: Apache webserver + PHP-FPM, MariaDB database, and all of my websites using Cloudflare and some more tricks. Now I’m focused on my cloud storage – NextCloud. Let’s make it blazing fast with Redis as an in-memory cache.