aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache
Commit message (Collapse)AuthorAgeFilesLines
* 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 #22278 from poporul/masterGodfrey Chan2016-01-151-3/+9
|\ | | | | Allow to store .keep file in cache directory
| * Allow to store .keep file in cache directoryAlexey Pokhozhaev2015-11-131-3/+9
| |
* | 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-193-3/+27
|/ /
* | keep deprecated namespaced_key in case any subclass uses itMichael Grosser2015-11-102-2/+2
| |
* | send normalized keys to the cache backends so they do not need to manage ↵Michael Grosser2015-11-103-25/+24
|/ | | | this themselves
* Merge pull request #22216 from grosser/grosser/fast-retRafael França2015-11-101-9/+12
|\ | | | | fast and consistent return when local_cache does not exist
| * fast and consistent return when local_cache does not existMichael Grosser2015-11-071-9/+12
| |
* | Merge pull request #22206 from grosser/grosser/drySantiago Pastorino2015-11-081-20/+15
|\ \ | |/ |/| dry up increment/decrement
| * dry up increment/decrementMichael Grosser2015-11-071-20/+15
| |
* | 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
* Merge pull request #22193 from grosser/grosser/multiEileen M. Uchitelle2015-11-061-3/+3
|\ | | | | call local_cache 1 time instead of 3 times
| * 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.
* | use prepend instead of extending every instanceMichael Grosser2015-11-063-30/+27
|/ | | | | 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
* Merge pull request #22194 from grosser/grosser/read-nilSean Griffin2015-11-051-3/+6
|\ | | | | cache nil replies from backend cache so misses are fast too
| * cache nil replies from backend cache so misses are fast tooMichael Grosser2015-11-051-3/+6
| |
* | Merge pull request #19889 from cedrics/long-uri-encoded-keysSean Griffin2015-10-201-3/+4
|\ \ | |/ |/| FileStore: Long cache keys may result in too long paths due to encoding
| * when checking for too long cache keys used the uri encoded fname Cedric Sohrauer2015-04-241-3/+4
| |
* | Merge pull request #20251 from davydovanton/doc-memory-storeRafael Mendonça França2015-05-212-2/+2
|\ \ | | | | | | Add nodoc label for protected Cache methods
| * | [skip ci] Add nodoc label for protected Cache methodsAnton Davydov2015-05-222-2/+2
| |/
* / [skip ci] Update documentation for MemCacheStore::build_mem_cacheAnton Davydov2015-05-211-1/+8
|/
* Allow AS::Cache::FileStore#clear without cache directoryKohei Suzuki2015-04-091-0/+1
| | | | | | Currently `Rails.cache.clear` raises Errno::ENOENT if it's run just after cloning a new Rails project. It should succeed without removing files or directories.
* Doc fix [ci skip]Sushruth Sivaramakrishnan2015-03-051-1/+1
|
* 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
* 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.
* fix error with long keys in ActiveSupport::Cache::FileStoreAdam Panzer2014-06-101-0/+5
|
* 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.
* 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.
* Copy-edit the parent commitRafael Mendonça França2013-12-121-6/+8
|
* Merge pull request #13268 from aayushkhandelwal11/masterRafael Mendonça França2013-12-121-22/+16
|\ | | | | | | Moving the common code of increment and decrement of cache file store in...
| * Moving the common code of increment and decrement of cache file store into ↵Aayush khandelwal2013-12-121-22/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | seprate function Removing the double checking for the value of id simplifying code for checking conditional code for key Removing the default values for parameters removing reduntant code and asiigning value of id in local variable removing wrongly added line break[ci ckip] reverting code
* | typo rectified [skip ci]Aayush khandelwal2013-12-112-2/+2
|/
* 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
* Merge pull request #11785 from grosser/grosser/file-unless-existRafael Mendonça França2013-10-281-0/+1
|\ | | | | | | | | | | | | | | support :unless_exist for FileCache Conflicts: activesupport/CHANGELOG.md activesupport/test/caching_test.rb
| * support :unless_exist for FileCachegrosser2013-08-301-0/+1
| |
* | Fix FileStore#cleanup to no longer rely on missing each_key methodMurray Steele2013-09-111-1/+2
|/
* Remove gist link from the codeRafael Mendonça França2013-08-271-1/+0
| | | | | | | It is not good to include links in the code. These links can be in the future outdated and nobody will upgrade they. [ci skip]
* Merge pull request #11546 from swoop-inc/ss_memory_store_cache_sizePiotr Sarnacki2013-07-221-3/+14
|\ | | | | [Fixes #11512] improves cache size calculation in MemoryStore
| * [Fixes #11512] improves cache size calculation in ↵Simeon Simeonov2013-07-221-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveSupport::Cache::MemoryStore Previously, the cache size of `ActiveSupport::Cache::MemoryStore` was calculated as the sum of the size of its entries, ignoring the size of keys and any data structure overhead. This could lead to the calculated cache size sometimes being 10-100x smaller than the memory used, e.g., in the case of small values. The size of a key/entry pair is now calculated via `#cached_size`: def cached_size(key, entry) key.to_s.bytesize + entry.size + PER_ENTRY_OVERHEAD end The value of `PER_ENTRY_OVERHEAD` is 240 bytes based on an [empirical estimation](https://gist.github.com/ssimeonov/6047200) for 64-bit MRI on 1.9.3 and 2.0. Fixes GH#11512 https://github.com/rails/rails/issues/11512
* | Add documentation for FileStore#increment and #decrementMatt Stopa2013-07-101-0/+4
| | | | | | | | [ci skip]