Currently Drush Cr or Cache Clear UI does not flush Redis cache

Created on 13 July 2016, over 8 years ago
Updated 1 November 2023, about 1 year ago

The current method for removing cached items from the Redis expires keys at 1 year, effectively not removing them from the cache. As Redis cannot remove keys systematically, and this modules allowing for sudo cache bins with the a prefix I understand why the keys are expired at a high rate. The problem is the expectation when running drush cr is that the entire cache is flushed at that time.

There is a simple way to solve the problem by doing either setting PTTL to 1 (millisecond) or TTL to 1 (sec) if supporting older Redis or just executing FLUSHALL.

Currently there is no way to flush the db.

Yes only using one prefix.
Example of whats happening

> redis-cli KEYS community_dev_:config:views.view.rising_sessions_search_view && redis-cli TTL community_dev_:config:views.view.rising_sessions_search_view && drush cr && redis-cli KEYS community_dev_:config:views.view.rising_sessions_search_view && redis-cli TTL community_dev_:config:views.view.rising_sessions_search_view
1) "community_dev_:config:views.view.rising_sessions_search_view"
(integer) 31535915
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `BASH_FUNC_module'
Cache rebuild complete.                                                                                                                        [ok]
1) "community_dev_:config:views.view.rising_sessions_search_view"
(integer) 31535998

You can see the expire time actually increased for the key after Drush

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ndrake86

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024