aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache/strategy
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #36656 from Edouard-chin/ec-local-cache-referenceRafael França2019-07-151-1/+4
|\ | | | | Return a copy of the cache entry when local_cache exists:
| * Return a copy of the cache entry when local_cache exists:Edouard CHIN2019-07-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | - When the local cache exists (during the request lifecycle), the entry returned from the LocalStore is passed as a reference which means mutable object can accidentaly get modified. This behaviour seems unnecessarily unsafe and is prone to issues like it happened in our application. This patch dup the `Entry` returned from the cache and dup it's internal value.
* | active_support/core_ext/object/duplicable is not in use hereRyuta Kamizono2019-07-161-1/+0
|/
* Fix Cache `read_multi` with local_cache return values.Jason Lee2018-03-211-1/+8
| | | | It should returns raw value, not instance of `ActiveSupport::Cache::Entry`.
* Caching: MemCache and Redis stores use local cache for multi-readsGabriel Sobrinho2018-02-231-0/+17
| | | | | Fixes #31909. Closes #31911.
* [Active Support] require_relative => requireAkira Matsuda2017-10-211-3/+3
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-112-0/+2
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-092-0/+2
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-3/+3
|
* 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-101-3/+3
| | | | | | | | | See https://github.com/rails/rails/issues/29067#issuecomment-301342084 for rationale. This reverts commit b76f82d714e590c20370e72fa36fa574c4f17650. Fixes #29067. Fixes #29081.
* 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.
* 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
* Privatize unneededly protected methods in Active SupportAkira Matsuda2016-12-241-7/+5
|
* Remove deprecated set_cache_valueAndrew White2016-11-131-8/+0
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* WhitespaceRafael Mendonça França2016-10-251-0/+1
|
* Merge pull request #25628 from ysksn/optionsRafael Mendonça França2016-08-171-3/+3
|\ | | | | | | Remove parameter "options = nil" for #clear
| * Update CHANGELOG.md for #25628 [ci skip]Yosuke Kabuto2016-07-021-3/+3
| | | | | | | | | | | | Move new CHANGELOG entry top [ci skip] Remove parameter "options = nil" for #clear
* | Add three new rubocop rulesRafael Mendonça França2016-08-161-2/+2
| | | | | | | | | | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* | applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
| |
* | applies new string literal convention in activesupport/libXavier Noria2016-08-062-7/+7
|/ | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Pass over all Rails 5 warnings, to make sure:Vipul A M2016-04-121-1/+1
| | | | | | | | | | - we are ending sentences properly - fixing of space issues - fixed continuity issues in some sentences. Reverts https://github.com/rails/rails/commit/8fc97d198ef31c1d7a4b9b849b96fc08a667fb02 . This change reverts making sure we add '.' at end of deprecation sentences. This is to keep sentences within Rails itself consistent and with a '.' at the end.
* add deprecations for a smooth transition after #22215Michael Grosser2015-11-191-3/+11
|
* keep deprecated namespaced_key in case any subclass uses itMichael Grosser2015-11-101-1/+1
|
* send normalized keys to the cache backends so they do not need to manage ↵Michael Grosser2015-11-101-2/+3
| | | | this themselves
* fast and consistent return when local_cache does not existMichael Grosser2015-11-071-9/+12
|
* do not override fetch on local cacheMichael Grosser2015-11-071-9/+5
| | | | | | fetch is supposed to behave differently, this was a mistake merged in https://github.com/rails/rails/pull/22194
* call local_cache 1 time instead of 3 timesMichael Grosser2015-11-061-3/+3
| | | | | LocalCache read_entry previously called the local_cache method 3 times, now it only calls it once and keeps the result in a local variable.
* cache nil replies from backend cache so misses are fast tooMichael Grosser2015-11-051-3/+6
|
* [skip ci] Add nodoc label for protected Cache methodsAnton Davydov2015-05-221-1/+1
|
* Doc fix [ci skip]Sushruth Sivaramakrishnan2015-03-051-1/+1
|
* Require rack/utilsRafael Mendonça França2014-08-191-0/+2
|
* Protect against error when parsing parameters with Bad RequestRafael Mendonça França2014-08-191-0/+3
| | | | Related with #11795.
* Add missing require so requiring `active_support/cache` works again.Lucas Mazza2014-04-091-0/+1
|
* - Rename `increment_or_decrement` to an apt `set_cache_value` since it ↵Vipul A M2014-03-241-4/+5
| | | | actually doesn't increment/decrement in localstore.
* Extract local cache middlewareArthur Neves2014-02-232-32/+41
| | | | | Extract LocalCache Middleware, so it can requires rack dependencies, without adding rack dependencies to `AS::Cache::Strategy::LocalCache`.
* clear cache on body close so that cache remains during renderingAaron Patterson2014-01-081-2/+8
| | | | | | | | fixes #13547 The body may use the local cache during rendering. `call`ing the app doesn't mean that rendering is finished, so we need to wait until `close` is called on the body.
* Stop using method missing for singleton delegation.Aaron Patterson2013-11-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This saved about 46 array allocations per request on an extremely simple application. The delegation happened in the notification subsystem which is a hotspot, so this should result in even more savings with larger apps. Squashed commit of the following: commit 41eef0d1479526f7de25fd4391d98e61c126d9f5 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Nov 6 16:32:31 2013 -0800 speed up notifications commit 586b4a18656f66fb2c518fb8e8fee66a016e8ae6 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Nov 6 16:31:05 2013 -0800 speed up runtime registry methods commit b67d074cb4314df9a88438f785868cef77e583d7 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Wed Nov 6 16:28:12 2013 -0800 change method name and make it public
* The increment and decrement commands in the local cache are exactly thewangjohn2013-04-171-18/+14
| | | | same, so their logic is being refactored.
* Refactored the storage of a temporary version of the local cache intowangjohn2013-04-171-8/+6
| | | | its own method.
* Add nodoc to LocalCacheRegistryRafael Mendonça França2013-04-171-1/+1
| | | [ci skip]
* Adding a local thread registry to store local caches.wangjohn2013-04-171-15/+32
|
* Fix "in memory" where it should be "in-memory".Cheah Chu Yeow2011-11-131-2/+2
|
* Revert "Fix "in memory" where it should be "in-memory"."Vijay Dev2011-11-111-2/+2
| | | | | | This reverts commit e34e4d43301618307f94123d3710f094297f91f3. Reason: code changes are not allowed in docrails.
* Fix "in memory" where it should be "in-memory".Cheah Chu Yeow2011-11-111-2/+2
|
* remove to_s implementation so that inspect is helpfulAaron Patterson2011-03-021-1/+0
|
* * LocalCache strategy is now a real middleware class, not an anonymous classAaron Patterson2011-03-021-23/+29
| | | | posing for pictures.
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* making comments meaningful by correcting, adding and pruningNeeraj Singh2010-07-261-5/+5
|