I don't understand how Craft CMS processes cache with Redis especially when saving to database/s?
My environment:
- Craft Pro 3.4.8
- PostgreSQL 12.2
- PHP-FPM 7.4.3
- Redis 5.0.7
I followed examples from the Application Configuration documentation and It seems that Craft CMS works well Redis. From inspecting both databases, sessions and queue work as expected.
queuetable is created in SQL DB but empty because all queue related storage is moved to Redis where I can see all the keysqueue.message_id,queue.messagesandqueue.waiting.queuetable will probably always stay in SQL DB from installation process.- when a session begins
tokenvalue is created insessionstable in SQL DB with some session related attributes and I also could locate the sametokenkey-value in Redis DB with additional info about current session. When session ended token was removed from both databases.
Cache
I created some matrix field content and I cached it.
I found out that a row with cacheKey and other attributes (along with body column) are created in templatecaches table in SQL DB.
Since using Redis I expected that all/most of cache related storage will be stored in Redis. Inspecting Redis and I couldn't find anything to cache related stuff.
cacheDurationto a time that CDN will cache new content. Then cache data from SQL DB will expire sooner therefore storage is freed. Anyway, good answer. – Dominik Krulak Feb 26 '20 at 18:59{% cache %}tag @DominikKrulak -> The Craft {% cache %} Tag In-Depth – andrew.welch Feb 26 '20 at 19:30