aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/mem_cache_store.rb
Commit message (Collapse)AuthorAgeFilesLines
* Switch to supports_cache_versioning? check to a class methodschneems2018-09-201-4/+2
| | | | | - Moving the `supports_cache_versioning?` check to a class method. - Shorten the method doc. - Expand on the error message.
* [close #33907] Error when using "recyclable" cache keys with a store that ↵schneems2018-09-201-0/+7
| | | | | | | | | | | | | | does not support it If you are using the "in cache versioning" also known as "recyclable cache keys" the cache store must be aware of this scheme, otherwise you will generate cache entries that never invalidate. This PR adds a check to the initialization process to ensure that if recyclable cache keys are being used via ``` config.active_record.cache_versioning = true ``` Then the cache store needs to show that it supports this versioning scheme. Cache stores can let Rails know that they support this scheme by adding a method `supports_in_cache_versioning?` and returning true.
* Add support for connection pooling on RedisCacheStorefatkodima2018-02-011-11/+2
|
* Revert "Merge pull request #31447 from fatkodima/redis_cache-connection_pool"George Claghorn2018-01-311-2/+11
| | | | | This reverts commit ac74e2c521f6ddc0eac02d74a1313261bcc1d60f, reversing changes made to ffdb06136152b3c5f7f4a93ca5928e16e755d228.
* Add support for connection pooling on RedisCacheStorefatkodima2018-01-221-11/+2
|
* Support for connection pooling on mem cache storeGabriel Sobrinho2018-01-181-9/+25
|
* add instrumentation for read_multiIgnatius Reza2017-12-291-22/+18
| | | | currently it's not possible to know what the hit rates are from read_multi
* Introduced `ActiveSupport::Digest` that allows to specify hash function ↵Dmitri Dolguikh2017-12-121-2/+1
| | | | | | | | implementation and defaults to `Digest::MD5`. Replaced calls to `::Digest::MD5.hexdigest` with calls to `ActiveSupport::Digest.hexdigest`.
* MemCacheStore: Support expiring countersTakumasa Ochi2017-11-201-2/+2
| | | | | | | Support `expires_in` in `ActiveSupport::Cache::MemCacheStore#increment` and `#decrement`. Closes #30716.
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-2/+2
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* Update links to use https instead of http [ci skip]Yoshiyuki Hirano2017-08-221-1/+1
|
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-2/+2
|
* Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-1/+7
|
* Restore 5.minutes changed in #28204Andrew White2017-03-151-1/+1
|
* Deprecate implicit coercion of `ActiveSupport::Duration`Andrew White2017-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `ActiveSupport::Duration` implicitly converts to a seconds value when used in a calculation except for the explicit examples of addition and subtraction where the duration is the receiver, e.g: >> 2 * 1.day => 172800 This results in lots of confusion especially when using durations with dates because adding/subtracting a value from a date treats integers as a day and not a second, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 2 * 1.day => Mon, 10 Apr 2490 To fix this we're implementing `coerce` so that we can provide a deprecation warning with the intent of removing the implicit coercion in Rails 5.2, e.g: >> 2 * 1.day DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration to a Numeric is deprecated and will raise a TypeError in Rails 5.2. => 172800 In Rails 5.2 it will raise `TypeError`, e.g: >> 2 * 1.day TypeError: ActiveSupport::Duration can't be coerced into Integer This is the same behavior as with other types in Ruby, e.g: >> 2 * "foo" TypeError: String can't be coerced into Integer >> "foo" * 2 => "foofoo" As part of this deprecation add `*` and `/` methods to `AS::Duration` so that calculations that keep the duration as the receiver work correctly whether the final receiver is a `Date` or `Time`, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 1.day * 2 => Fri, 03 Mar 2017 Fixes #27457.
* Privatize unneededly protected methods in Active SupportAkira Matsuda2016-12-241-8/+6
|
* Removes 'raw: true' from MemCacheStore#read_multi, per ↵Jonathan Hyman2016-11-161-1/+1
| | | | https://github.com/rails/rails/issues/27066.
* Remove deprecated escape_keyAndrew White2016-11-131-8/+0
|
* change `MemCacheStore#increment` and `MemCacheStore#decrement` to public API ↵yuuji.yaginuma2016-09-181-2/+2
| | | | | | | | | | | | | [ci skip] I'm not sure why these methods not public. But these methods are public in other cache stores, I think that may be in public. Ref: http://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache/Store.html#method-i-increment http://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache/FileStore.html#method-i-increment http://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache/MemoryStore.html#method-i-increment http://edgeapi.rubyonrails.org/classes/ActiveSupport/Cache/NullStore.html#method-i-increment
* Add three new rubocop rulesRafael Mendonça França2016-08-161-3/+3
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-14/+14
|
* modernizes hash syntax in activesupportXavier Noria2016-08-061-3/+3
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-4/+4
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Revert "Instrument read_multi".Kasper Timm Hansen2016-02-201-9/+7
| | | | | | | | | | | | | | | | | | Reevaluating the log output generated from this instrumentation, we've found that it wasn't all that useful in practice. ``` Caches multi read: - views/david/2/4184ab71db6849621a4d8820fcd2c0ad - views/david/2/4184ab71db6849621a4d8820fcd2c0ad - views/david/3/4184ab71db6849621a4d8820fcd2c0ad - views/david/3/4184ab71db6849621a4d8820fcd2c0ad ``` If rendering many templates the output is inscrutable, and it's impossible to see how many cache misses there were. Revert ca6aba7f30 and implement a better way later.
* Merge pull request #22202 from grosser/grosser/write-consistentArthur Nogueira Neves2015-12-051-4/+4
|\ | | | | even if a write fails, store the raw value
| * even if a write fails, store the raw valueMichael Grosser2015-11-291-4/+4
| |
* | Merge pull request #22361 from grosser/grosser/rescueArthur Nogueira Neves2015-11-301-26/+19
|\ \ | |/ |/| rescue memcached errors in a consistent way
| * rescue memcached errors in a consistent wayMichael Grosser2015-11-291-26/+19
| |
* | add deprecations for a smooth transition after #22215Michael Grosser2015-11-191-0/+8
|/
* send normalized keys to the cache backends so they do not need to manage ↵Michael Grosser2015-11-101-8/+8
| | | | this themselves
* use prepend instead of extending every instanceMichael Grosser2015-11-061-25/+25
| | | | | extending an instance with a module puts the methods on top of it, prepend does the same but on the class level, so less work for us and more standard way of doing things
* [skip ci] Update documentation for MemCacheStore::build_mem_cacheAnton Davydov2015-05-211-1/+8
|
* Instrument read_multi.Kasper Timm Hansen2015-02-211-7/+10
| | | | | | | | | | Adds `read_multi` instrumentation formatted as: Caches multi read: - views/david/2/4184ab71db6849621a4d8820fcd2c0ad - views/david/2/4184ab71db6849621a4d8820fcd2c0ad - views/david/3/4184ab71db6849621a4d8820fcd2c0ad - views/david/3/4184ab71db6849621a4d8820fcd2c0ad
* Add 'e' var on rescue DalliError, in order to log itArthur Neves2014-01-061-2/+2
|
* Raise if MemCacheStore doenst receive a Dalli objArthur Neves2014-01-031-0/+3
| | | | | | :mem_cache_store should receive a list of hosts or a dalli client, otherwise raise it. Also adding a changelog.
* mem_cache_store requires dalli, so only accept dalli/clientArthur Neves2014-01-031-6/+1
| | | | | | | :mem_cache_store require dalli, rescue Dalli exceptions, and follow Dalli API. Memcached gem, for instance, doesnt work anymore, as the API are different. As we already require one client, we should make sure that client works, and not accept others, and if someone wants to use another memcache client they can write their own store adapter.
* Missing require extract_optionsAkira Matsuda2013-01-311-0/+1
|
* Use already defined Encoding constants rather than creating one-trip StringsAkira Matsuda2013-01-281-1/+1
|
* Patched Marshal#load to work with constant autoloading ↵Uriel Katz2012-12-011-0/+1
| | | | (active_support/dependecies.rb) (issue #8167)
* Padding expires_in by 5 minutes on dalli key write to facilitate ↵Mike Evans2012-10-111-0/+4
| | | | :race_condition_ttl working correctly.
* Replace deprecated `memcache-client` gem with `dalli` in ↵Guillermo Iguaran2012-08-171-32/+21
| | | | | | ActiveSupport::Cache::MemCacheStore memcache-client was deprecated in favour of dalli in 2010.
* remove unnecessary require core_ext/string/encodingSergey Nartimov2012-02-141-1/+0
|
* deprecate String#encoding_aware? and remove its usageSergey Nartimov2011-12-241-1/+1
|
* Fix "in memory" where it should be "in-memory".Cheah Chu Yeow2011-11-131-1/+1
|
* Revert "Fix "in memory" where it should be "in-memory"."Vijay Dev2011-11-111-1/+1
| | | | | | This reverts commit e34e4d43301618307f94123d3710f094297f91f3. Reason: code changes are not allowed in docrails.
* Update Memcached website to its new one at http://memcached.org/.Cheah Chu Yeow2011-11-111-1/+1
|
* Fix "in memory" where it should be "in-memory".Cheah Chu Yeow2011-11-111-1/+1
|
* MemcacheStore: deserialize the entry reading from local_cache when using rawDingding Ye2011-06-101-0/+8
|