CacheVersion lets you maintain a version for any class. This can be used for cache invalidation, and RecordCache and MethodCache use it for that. It uses memcache to reduce database access when the version of a class hasn't changed.
CacheVersion.get(User) # => 0 CacheVersion.increment(User) CacheVersion.get(User) # => 1 # Or you can use the alternate syntax: User.version # => 1 User.increment_version User.version # => 2
sudo gem install cache-version -s http://gemcutter.org
Also, you need to create a migration to make the cache_versions table. See examples/sample_migration.rb
Copyright © 2009 Justin Balthrop, Geni.com; Published under The MIT License, see LICENSE