rtomayko / rack-cache

Real HTTP Caching for Ruby Web Apps
http://rtomayko.github.io/rack-cache/
Other
822 stars 124 forks source link

Rack::Cache quickly fills up entitystore with old content #72

Open mperham opened 12 years ago

mperham commented 12 years ago

We're using redis-rack-cache for our store. We found that our Redis install was quickly taking all available memory, even though our pages are Cache-Control: public, max-age=180.

What I discovered is that rack-cache.use_native_ttl is not documented and not enabled by default; the Redis driver sets the content with no expiration at all meaning Redis will keep it around forever.

1) Could you document this flag? I was going off of this page: http://rtomayko.github.com/rack-cache/configuration 2) Does it make sense to enable this flag by default so it doesn't happen to others?

mperham commented 12 years ago

It looks like MetaStore doesn't support native TTL at all so Redis will eventually fill up with cruft anyways.