aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-10-21 12:42:06 -0700
committerJosé Valim <jose.valim@gmail.com>2011-10-21 12:42:06 -0700
commit79d01a8f16e20c556a086a2f07e3ccb4400f9819 (patch)
tree28e31a1c0a15d4ec1935f914668e1b912cbc276d /railties/guides
parentb838570bd69ff13d677fb43e79f10d6f3168c696 (diff)
parentec93f363cab7270c1469b420a52a21e306a89c30 (diff)
downloadrails-79d01a8f16e20c556a086a2f07e3ccb4400f9819.tar.gz
rails-79d01a8f16e20c556a086a2f07e3ccb4400f9819.tar.bz2
rails-79d01a8f16e20c556a086a2f07e3ccb4400f9819.zip
Merge pull request #3395 from bdurand/fix_file_store_cleanup
Fix ActiveSupport::Cache::FileStore.cleanup to actually work.
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/caching_with_rails.textile6
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/guides/source/caching_with_rails.textile b/railties/guides/source/caching_with_rails.textile
index 4273d0dd64..721c791a33 100644
--- a/railties/guides/source/caching_with_rails.textile
+++ b/railties/guides/source/caching_with_rails.textile
@@ -289,7 +289,11 @@ ActionController::Base.cache_store = :file_store, "/path/to/cache/directory"
With this cache store, multiple server processes on the same host can share a cache. Servers processes running on different hosts could share a cache by using a shared file system, but that set up would not be ideal and is not recommended. The cache store is appropriate for low to medium traffic sites that are served off one or two hosts.
-Note that the cache will grow until the disk is full unless you periodically clear out old entries.
+Note that the cache will grow until the disk is full unless you periodically clear out old entries. You can call +ActiveSupport::Cache::FileStore#cleanup+ to remove entries older than a specified time.
+
+<ruby>
+Rails.cache.cleanup(:not_accessed_in => 2.days)
+</ruby>
h4. ActiveSupport::Cache::MemCacheStore