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

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.
Dominik Schöler