How to inspect Rails view cache keys (when using Redis)

Posted . Visible to the public.

When your Rails application is using Redis as its cache store, this is how you can list existing keys:

  1. Check: Rails.cache should return an ActiveSupport::Cache::RedisCacheStore.
  2. Rails.cache.redis.with(&:keys) lists existing keys. Cached views start with "views/".
    Caution! The list of keys may be huge in production.
Profile picture of Dominik Schöler
Dominik Schöler
Last edit
Dominik Schöler
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2025-11-07 16:18)