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:
- Check:
Rails.cacheshould return anActiveSupport::Cache::RedisCacheStore. -
Rails.cache.redis.with(&:keys)lists existing keys. Cached views start with "views/".
Caution! The list of keys may be huge in production.