aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache
Commit message (Collapse)AuthorAgeFilesLines
* Fix unclosed tags in `RedisCacheStore` docs [ci skip]yuuji.yaginuma2018-03-191-1/+1
|
* Redis cache store: fix constructing with a Redis instanceAdam Richardson2018-03-121-1/+1
| | | | | | | | Since `Redis#call` duck types as a Proc, we'd call `#call` on it, thinking it's a Proc. Fixed by check for the Proc explicitly instead of duck typing on `#call`. References #32233
* Caching: MemCache and Redis stores use local cache for multi-readsGabriel Sobrinho2018-02-231-0/+17
| | | | | Fixes #31909. Closes #31911.
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-171-1/+0
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Merge pull request #31866 from fatkodima/redis_cache-connection_poolRafael Mendonça França2018-02-142-22/+31
|\ | | | | | | Add support for connection pooling on RedisCacheStore
| * Add support for connection pooling on RedisCacheStorefatkodima2018-02-012-22/+31
| |
* | Doc: fixes typo `cache:` -> `compress:`Joseph Page2018-02-121-1/+1
| | | | | | | | | | | | [ci skip] Closes #31967
* | Use Redis#mget for RedisCacheStore#fetch_multifatkodima2018-02-051-0/+8
| |
* | Add missing instrumentation to RedisCacheStore#read_multifatkodima2018-02-051-1/+5
| |
* | Redis cache store: consolidate serializationJeremy Daer2018-02-041-17/+21
| | | | | | | | Use `serialize_entry` throughout and introduce `serialize_entries`.
* | RedisCacheStore: fix `#write_multi` mset serializationfatkodima2018-02-041-1/+8
|/ | | | | Closes #31886 Fixes #31884
* Revert "Merge pull request #31447 from fatkodima/redis_cache-connection_pool"George Claghorn2018-01-312-54/+23
| | | | | This reverts commit ac74e2c521f6ddc0eac02d74a1313261bcc1d60f, reversing changes made to ffdb06136152b3c5f7f4a93ca5928e16e755d228.
* Improve fault tolerance for redis cache storefatkodima2018-01-231-4/+11
|
* Add support for connection pooling on RedisCacheStorefatkodima2018-01-222-23/+54
|
* Support for connection pooling on mem cache storeGabriel Sobrinho2018-01-181-9/+25
|
* Convert keys to binary in the Redis cache storeGeorge Claghorn2018-01-171-1/+1
| | | | Fix encoding errors when using the pure-Ruby Redis driver instead of Hiredis. Dodge incompatibilities between UTF-8 and arbitrary value encodings, which rear their heads when the Redis driver tries to build a single command string from incompatibly-encoded keys and values.
* Fix constant referenceGeorge Claghorn2018-01-161-1/+1
| | | | Update the long key handling test so it triggers truncation in the Redis cache store.
* 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
* RedisCacheStore - Fix Default Error HandlerJesse Doyle2017-12-141-3/+5
| | | | | | | | | * The `DEFAULT_ERROR_HANDLER` constant in `ActiveSupport::Cache::RedisCacheStore` contained references to an undefined argument `e`, which is supposed to refer to the `exception` parameter. * Update the default error handler proc to correctly reference the `exception` parameter.
* Introduced `ActiveSupport::Digest` that allows to specify hash function ↵Dmitri Dolguikh2017-12-122-3/+2
| | | | | | | | implementation and defaults to `Digest::MD5`. Replaced calls to `::Digest::MD5.hexdigest` with calls to `ActiveSupport::Digest.hexdigest`.
* Update incorrect backtick usage in RDoc to teletypeT.J. Schuck2017-11-221-5/+5
| | | [ci skip]
* MemCacheStore: Support expiring countersTakumasa Ochi2017-11-201-2/+2
| | | | | | | Support `expires_in` in `ActiveSupport::Cache::MemCacheStore#increment` and `#decrement`. Closes #30716.
* Generate `keys` instead of `keys_to_names`Ryuta Kamizono2017-11-201-3/+3
| | | | `keys_to_names` is used only for `keys_to_names.keys`.
* Fix "warning: assigned but unused variable - key"yuuji.yaginuma2017-11-181-1/+1
| | | | Ref: https://travis-ci.org/rails/rails/jobs/303840778#L1974
* Built-in Redis cache storeJeremy Daer2017-11-131-0/+404
| | | | | | | | | | | * Supports vanilla Redis, hiredis, and Redis::Distributed. * Supports Memcached-like sharding across Redises with Redis::Distributed. * Fault tolerant. If the Redis server is unavailable, no exceptions are raised. Cache fetches are treated as misses and writes are dropped. * Local cache. Hot in-memory primary cache within block/middleware scope. * `read_/write_multi` support for Redis mget/mset. Use Redis::Distributed 4.0.1+ for distributed mget support. * `delete_matched` support for Redis KEYS globs.
* [Active Support] require_relative => requireAkira Matsuda2017-10-213-8/+8
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* Fixes ActiveSupport::Cache::FileStore#cleanup bug which prevented it from ↵Erich Soares Machado2017-10-031-3/+2
| | | | cleaning up the expired cache keys
* 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-116-0/+6
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-096-0/+6
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-013-8/+8
|
* Cache: test coverage for cleanup behavior with local cache strategyEugene Kenny2017-06-101-1/+1
| | | | | | No need to pass `#cleanup` options through to `LocalCache#clear`. Fixes #29081. References #25628.
* Revert #25628. Incomplete change + needs a deprecation cycle.Jeremy Daer2017-06-102-4/+4
| | | | | | | | | See https://github.com/rails/rails/issues/29067#issuecomment-301342084 for rationale. This reverts commit b76f82d714e590c20370e72fa36fa574c4f17650. Fixes #29067. Fixes #29081.
* Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-1/+7
|
* Don't cache locally if unless_exist was passedEugene Kenny2017-05-141-1/+6
| | | | | | | | | | Some cache backends support the `unless_exist` option, which tells them not to overwrite an existing entry. The local cache currently always stores the new value, even though the backend may have rejected it. Since we can't tell which value will end up in the backend cache, we should delete the key from the local cache, so that the next read for that key will go to the backend and pick up the correct value.
* Restore 5.minutes changed in #28204Andrew White2017-03-151-1/+1
|
* AS:Cache:MemoryStore doc fixes [ci skip] (#28389)Vipul A M2017-03-121-1/+1
|
* Merge pull request #27051 from devonestes/adding-cache-clear-docsVipul A M2017-03-121-0/+2
|\ | | | | Add missing documentation for MemoryStore#clear [ci skip]
| * Add missing documentation for MemoryStore#clear [ci skip]Devon Estes2016-11-151-0/+2
| | | | | | | | | | We were missing some form of documentation for this method, so I've gone ahead and added some!
* | Make sure local cache cleared even it's throwing:Lin Jen-Shin2017-03-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We (GitLab) hit into an issue that somewhere in the middleware chain was throwing `:warden`, which was caught in the wrapping middleware, but `LocalCache::Middleware` was not aware of it. It should look like: ``` ruby result = catch(:warden) do @app.call(env) end ``` Source: https://github.com/hassox/warden/blob/090ed153dbd2f5bf4a1ca672b3018877e21223a4/lib/warden/manager.rb#L35-L37 Using `ensure` could make sure that we would always do the cleanup, and better yet, avoid `rescue Exception` which we all should know that could cause some issues which could be very hard to debug. Please check the discussion thread for more context: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1402#note_25128108
* | 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-245-28/+21
| |
* | No need to nodoc private methodsAkira Matsuda2016-12-241-1/+1
| |
* | Removes 'raw: true' from MemCacheStore#read_multi, per ↵Jonathan Hyman2016-11-161-1/+1
|/ | | | https://github.com/rails/rails/issues/27066.
* Remove deprecated set_cache_valueAndrew White2016-11-131-8/+0
|
* Remove deprecated escape_keyAndrew White2016-11-131-8/+0
|
* Remove deprecated key_file_pathAndrew White2016-11-131-8/+0
|
* Merge pull request #26536 from ↵Arthur Nogueira Neves2016-11-041-2/+2
|\ | | | | | | | | y-yagi/change_increment_and_decrement_to_public_api change `MemCacheStore#increment` and `MemCacheStore#decrement` to public API [ci skip]
| * 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 more rubocop rules about whitespacesRafael Mendonça França2016-10-292-3/+3
| |