aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/memory_store.rb
diff options
context:
space:
mode:
authorHongli Lai (Phusion) <hongli@phusion.nl>2008-10-26 22:25:52 +0100
committerHongli Lai (Phusion) <hongli@phusion.nl>2008-10-26 22:25:52 +0100
commit295195b707d556610156349185bf9b5bf435abb1 (patch)
treedebaaa35804b444a82d8929992916545192cbf56 /activesupport/lib/active_support/cache/memory_store.rb
parent094a910653f9440505387da14a542f51929a7c1f (diff)
downloadrails-295195b707d556610156349185bf9b5bf435abb1.tar.gz
rails-295195b707d556610156349185bf9b5bf435abb1.tar.bz2
rails-295195b707d556610156349185bf9b5bf435abb1.zip
Write documentation for the cache stores.
Diffstat (limited to 'activesupport/lib/active_support/cache/memory_store.rb')
-rw-r--r--activesupport/lib/active_support/cache/memory_store.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/cache/memory_store.rb b/activesupport/lib/active_support/cache/memory_store.rb
index c1a713b4c5..1b30d49155 100644
--- a/activesupport/lib/active_support/cache/memory_store.rb
+++ b/activesupport/lib/active_support/cache/memory_store.rb
@@ -1,5 +1,19 @@
module ActiveSupport
module Cache
+ # A cache store implementation which stores everything into memory in the
+ # same process. If you're running multiple Ruby on Rails server processes
+ # (which is the case if you're using mongrel_cluster or Phusion Passenger),
+ # then this means that your Rails server process instances won't be able
+ # to share cache data with each other. If your application never performs
+ # manual cache item expiry (e.g. when you're using generational cache keys),
+ # then using MemoryStore is ok. Otherwise, consider carefully whether you
+ # should be using this cache store.
+ #
+ # MemoryStore is not only able to store strings, but also arbitrary Ruby
+ # objects.
+ #
+ # MemoryStore is not thread-safe. Use SynchronizedMemoryStore instead
+ # if you need thread-safety.
class MemoryStore < Store
def initialize
@data = {}