rails/activesupport/test
Brian Durand ee51b51b60 ActiveSupport::Cache refactoring
All Caches

* Add default options to initializer that will be sent to all read, write, fetch, exist?, increment, and decrement
* Add support for the :expires_in option to fetch and write for all caches. Cache entries are stored with the create timestamp and a ttl so that expiration can be handled independently of the implementation.
* Add support for a :namespace option. This can be used to set a global prefix for cache entries.
* Deprecate expand_cache_key on ActiveSupport::Cache and move it to ActionController::Caching and ActionDispatch::Http::Cache since the logic in the method used some Rails specific environment variables and was only used by ActionPack classes. Not very DRY but there didn't seem to be a good shared spot and ActiveSupport really shouldn't be Rails specific.
* Add support for :race_condition_ttl to fetch. This setting can prevent race conditions on fetch calls where several processes try to regenerate a recently expired entry at once.
* Add support for :compress option to fetch and write which will compress any data over a configurable threshold.
* Nil values can now be stored in the cache and are distinct from cache misses for fetch.
* Easier API to create new implementations. Just need to implement the methods read_entry, write_entry, and delete_entry instead of overwriting existing methods.
* Since all cache implementations support storing objects, update the docs to state that ActiveCache::Cache::Store implementations should store objects. Keys, however, must be strings since some implementations require that.
* Increase test coverage.
* Document methods which are provided as convenience but which may not be universally available.

MemoryStore

* MemoryStore can now safely be used as the cache for single server sites.
* Make thread safe so that the default cache implementation used by Rails is thread safe. The overhead is minimal and it is still the fastest store available.
* Provide :size initialization option indicating the maximum size of the cache in memory (defaults to 32Mb).
* Add prune logic that removes the least recently used cache entries to keep the cache size from exceeding the max.
* Deprecated SynchronizedMemoryStore since it isn't needed anymore.

FileStore

* Escape key values so they will work as file names on all file systems, be consistent, and case sensitive
* Use a hash algorithm to segment the cache into sub directories so that a large cache doesn't exceed file system limits.
* FileStore can be slow so implement the LocalCache strategy to cache reads for the duration of a request.
* Add cleanup method to keep the disk from filling up with expired entries.
* Fix increment and decrement to use file system locks so they are consistent between processes.

MemCacheStore

* Support all keys. Previously keys with spaces in them would fail
* Deprecate CompressedMemCacheStore since it isn't needed anymore (use :compress => true)

[#4452 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-27 11:13:37 -07:00
..
autoloading_fixtures Checkin failing test case related to load once paths 2006-12-24 14:41:29 +00:00
core_ext Use explicit source encoding rather than forced UTF-8 from US-ASCII. 2010-04-26 14:45:23 -07:00
dependencies Checkin failing test case related to load once paths 2006-12-24 14:41:29 +00:00
fixtures deOMGifying Railties, Active Support, and Action Pack 2010-01-31 09:46:30 -08:00
json JSON: encode objects that don't have a native JSON representation using to_hash, if available, instead of instance_values (the old fallback) or to_s (other encoders' default). Encode BigDecimal and Regexp encode as strings to conform with other encoders. Try to transcode non-UTF-8 strings. 2010-04-26 19:55:39 -07:00
xml_mini Fixed some bugs and fixed some tests in new SAX-based XmlMini backends. 2010-01-01 13:18:03 -08:00
abstract_unit.rb avoid method redefined; discarding old empty? warning [#4302 state:committed] 2010-03-30 16:59:48 -07:00
autoload.rb Reorganize autoloads: 2009-12-02 20:01:08 -08:00
benchmarkable_test.rb Get rid of stray require again 2009-10-15 17:39:19 -07:00
buffered_logger_test.rb Fix dependencies revealed by testing in isolation 2009-04-22 18:54:13 -07:00
caching_test.rb ActiveSupport::Cache refactoring 2010-04-27 11:13:37 -07:00
callback_inheritance_test.rb Added missing requires abstract_unit and activesupport to the loadpath of ts_isolated [#4215 state:committed] 2010-03-18 17:50:28 -07:00
callbacks_test.rb Added missing requires abstract_unit and activesupport to the loadpath of ts_isolated [#4215 state:committed] 2010-03-18 17:50:28 -07:00
clean_backtrace_test.rb ActiveSupport::BacktraceCleaner#remove_filters! allows for completely untouched backtrace [#4079 state:resolved] 2010-04-10 14:06:10 +02:00
clean_logger_test.rb Explicit test dependencies 2009-03-28 23:56:14 -07:00
concern_test.rb AS::Concern redefines "include" to lazy include modules as dependencies 2009-05-29 17:03:23 -05:00
configurable_test.rb Clean up the config object in ActionPack. Create config_accessor which just delegates to the config object, reducing the number of deprecations and add specific tests. 2010-04-22 12:00:13 +02:00
dependencies_test.rb Make dependencies_test pass running standalone [#4215 state:resolved] 2010-03-18 17:50:28 -07:00
deprecation_test.rb Modify backtrace test to take implementations with slightly different backtrace output into consideration. 2009-12-13 10:40:00 -05:00
empty_bool.rb avoid method redefined; discarding old empty? warning [#4302 state:committed] 2010-03-30 16:59:48 -07:00
flush_cache_on_private_memoization_test.rb Added missing requires abstract_unit and activesupport to the loadpath of ts_isolated [#4215 state:committed] 2010-03-18 17:50:28 -07:00
gzip_test.rb Added a test for Gzip 2008-06-02 17:42:10 -05:00
i18n_test.rb No need for test stub 2009-11-14 03:27:18 -08:00
inflector_test_cases.rb Improve reliability of Inflector.transliterate. [#4374 state:resolved] 2010-04-12 23:19:39 -07:00
inflector_test.rb Fix that irregular plural inflections should not be double-pluralized: 'people'.pluralize should return 'people' not 'peoples'. 2009-08-09 20:28:57 -07:00
isolation_test.rb deOMGifying Railties, Active Support, and Action Pack 2010-01-31 09:46:30 -08:00
load_paths_test.rb CI has a bunch of duplicate load paths 2010-02-15 10:53:44 -06:00
memoizable_test.rb Escaping symbol passed into Memoizable's flush_cache for query methods to allow them to be cleared 2009-09-28 14:48:13 +13:00
message_encryptor_test.rb Ruby 1.9.2: marshaling round-trips Time#zone 2010-03-28 22:52:08 -07:00
message_verifier_test.rb Ruby 1.9.2: marshaling round-trips Time#zone 2010-03-28 22:52:08 -07:00
multibyte_chars_test.rb Use explicit source encoding rather than forced UTF-8 from US-ASCII. 2010-04-26 14:45:23 -07:00
multibyte_conformance.rb Move multibyte test helpers to a separate file and make the conformance tests run again. 2008-09-21 17:37:38 +02:00
multibyte_test_helpers.rb Set encoding of the multibyte test helpers file to UTF-8 so the strings can be read by Ruby 1.9. 2008-09-21 18:31:15 +02:00
multibyte_unicode_database_test.rb Require mocha >= 0.9.0 for AS tests 2008-11-22 19:19:12 -08:00
multibyte_utils_test.rb Ditto 2009-11-09 16:59:38 -08:00
notifications_test.rb allow unsubscribe by name or subscription [#4433 state:resolved] 2010-04-24 22:06:24 -07:00
option_merger_test.rb Explicit test dependencies 2009-03-28 23:56:14 -07:00
ordered_hash_test.rb Adding custom yaml (de-)serialization for OrderedHash 2010-01-27 15:29:06 -08:00
ordered_options_test.rb Namespace Inflector, Dependencies, OrderedOptions, and TimeZone under ActiveSupport [#238 state:resolved] 2008-06-03 13:32:53 -05:00
rescuable_test.rb No need to emulate default Ruby behavior in initialize 2010-02-10 14:40:36 -08:00
safe_buffer_test.rb Deleted all references to ActionView::SafeBuffer in favor of ActiveSupport::SafeBuffer 2010-01-31 22:14:18 -08:00
secure_random_test.rb 1.8 compatibility for random_number method on SecureRandom. 2008-10-04 21:11:30 +02:00
string_inquirer_test.rb Ruby 1.9 compat: rename deprecated assert_raises to assert_raise. 2009-03-08 13:11:58 -07:00
test_test.rb avoid method redefined; discarding old empty? warning [#4302 state:committed] 2010-03-30 16:59:48 -07:00
time_zone_test.rb Switch to TimezoneProxy for later support of deferred TZ loading 2010-04-20 10:54:37 -07:00
transliterate_test.rb Improve reliability of Inflector.transliterate. [#4374 state:resolved] 2010-04-12 23:19:39 -07:00
ts_isolated.rb Added missing requires abstract_unit and activesupport to the loadpath of ts_isolated [#4215 state:committed] 2010-03-18 17:50:28 -07:00
whiny_nil_test.rb Make many parts of Rails lazy. In order to facilitate this, 2010-03-07 06:24:30 -08:00