codenoble / cache-crispies

Speedy Rails JSON serialization with built-in caching
MIT License
156 stars 16 forks source link

Caching never expires #82

Open PascalVanVlaenderen opened 3 months ago

PascalVanVlaenderen commented 3 months ago

Hi all,

We've been happy customers of CacheCrispies and have been using do_caching true on some models.

However now we've noticed that these models are never expired, our Redis cache keeps on growing.

I read the code and the docs just specify use X as caching method.

What's the advice on ensuring the CacheCrispies models are expired without setting a default expiration on the full Rails cache?

PascalVanVlaenderen commented 3 months ago

Currently using


CacheCrispies.configure do |config|
  config.etags = false
  config.cache_store = ActiveSupport::Cache::RedisCacheStore.new(url: ENV.fetch("REDIS_URL"), expires_in: 1.hour)
end