This is a sample example for using Redis as a database cache in Vapor 4. The code caches the records from database element-by-element, which can degrade the performance of Redis cache. Furthur development is on your hand.
One may use this code freely. However, it would be appreciated if you give a comment this git repository is the origin of your adaptation.