aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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]
* | Add documentation for #clear on certain Store classesMatt Stopa2013-07-102-0/+2
| | | | | | | | [ci skip
* | Update the filestore documentation for clearMatt Stopa2013-07-091-0/+3
|/ | | | [ci skip]
* 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 deletion of empty directories:Charles Jones2013-02-251-2/+2
| | | | | | | | | | | | | | | 1. When comparing the directory to delete against the top level cache_path, use File.realpath to make sure we aren't comparing two unequal strings that point to the same path. This occurs, for example, when cache_path has a trailing slash, which it does in the default Rails configuration. Since the input to delete_empty_directories never has a trailing slash, the comparison will never be true and the top level cache directory (and above) may be deleted. However… 2. File.delete raises EPERM when trying to delete a directory, so no directories have ever been deleted. Changing the code to Dir.delete fixes that.
* 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-012-0/+2
| | | | (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.
* Optimize ActiveSupport::Cache::Entry to reduce memory and processing overhead.Brian Durand2012-09-301-0/+1
|
* 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.