aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* removes usage of Object#in? from the code base (the method remains defined ↵Xavier Noria2012-08-061-4/+3
| | | | | | | | | | | | | | | | | | | by Active Support) Selecting which key extensions to include in active_support/rails made apparent the systematic usage of Object#in? in the code base. After some discussion in https://github.com/rails/rails/commit/5ea6b0df9a36d033f21b52049426257a4637028d we decided to remove it and use plain Ruby, which seems enough for this particular idiom. In this commit the refactor has been made case by case. Sometimes include? is the natural alternative, others a simple || is the way you actually spell the condition in your head, others a case statement seems more appropriate. I have chosen the one I liked the most in each case.
* Merge pull request #5125 from winston/log_exception_when_cache_read_failsMichael Koziarski2012-05-211-1/+2
|\ | | | | #read_entry in ActiveSupport::Cache::FileStore should log details of the exception when an exception is thrown
| * #read_entry in ActiveSupport::Cache::FileStore should log details of the ↵Winston2012-02-221-1/+2
| | | | | | | | exception when an exception is thrown.
* | Remove wrong rack/utils dependency from ASSantiago Pastorino2012-05-121-3/+3
| | | | | | | | Closes #6274
* | add unless_exist option to memory storegrosser2012-05-101-0/+1
| |
* | Merge pull request #4452 from tapajos/e5425c8f68fbb720fcbf4b14e1f154ac27dbbbedAaron Patterson2012-05-031-1/+1
|\ \ | | | | | | Fix cache (FileStore) clear to keep .gitkeep.
| * | Cache (FileStore) clear should keep .gitkeepMarcos Tapajos2012-01-131-1/+1
| | |
* | | Merge pull request #4911 from Floppy/masterAaron Patterson2012-03-301-1/+1
|\ \ \ | |_|/ |/| | Reduce FILENAME_MAX_SIZE in ActiveSupport::Cache::FileStore
| * | Change FILENAME_MAX_SIZE in FileStore to 228.James Smith2012-02-061-1/+1
| |/ | | | | | | In order that temp filenames generated from it will fit in 255 chars. See https://github.com/rails/rails/issues/4907
* | Bug: cache_path.size doesn't return length of filename but size of file if ↵Issei Naruta2012-02-211-1/+1
| | | | | | | | cache_path is Pathname.
* | 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
|
* Add ActiveSupport::Cache::NullStore to expose caching interface without ↵Brian Durand2011-12-121-0/+44
| | | | actually caching for development and test environments.
* Fix "in memory" where it should be "in-memory".Cheah Chu Yeow2011-11-133-4/+4
|
* Revert "Fix "in memory" where it should be "in-memory"."Vijay Dev2011-11-113-4/+4
| | | | | | 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-113-4/+4
|
* Refactor ActiveSupport::Cache::FileStore. used method and deleted duplicate ↵kennyj2011-10-301-3/+4
| | | | code.
* Added fix so that file store does not raise an exception when cache dir does ↵Philippe Huibonhoa2011-09-291-0/+1
| | | | not exist yet. This can happen if a delete_matched is called before anything is saved in the cache.
* No need to create a range objectSantiago Pastorino2011-09-221-3/+3
|
* Fixed issue in file store where it could create a filename that was too long ↵Philippe Huibonhoa2011-09-211-9/+8
| | | | for the file system. (https://github.com/rails/rails/issues/3072)
* Fix ActiveSupport::Cache::FileStore#file_path_key does not work if ↵Gonzalo Rodriguez2011-07-231-1/+1
| | | | | | initialized with Pathname Port from 3-1-stable
* MemcacheStore: deserialize the entry reading from local_cache when using rawDingding Ye2011-06-101-0/+8
|
* Make MemCacheStore work with Ruby 1.9 and -KuAndrew White2011-05-311-1/+1
|
* Removed deprecated methods and related tests from ActiveSupportJosh Kalderimis2011-05-253-37/+1
|
* Tidy up previous commit.José Valim2011-04-281-3/+8
|
* Merged pull request #219 from panthomakos/memcache.José Valim2011-04-281-1/+4
|\ | | | | Character encoding issues with MemCacheStore in 1.9.2
| * Fixed special character encoding issue with MemCacheStore in Ruby 1.9.2.Pan Thomakos2011-03-111-1/+4
| |
* | File should be open in read/write mode. When doing lock on a file.Arun Agrawal2011-04-181-1/+1
| |