| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The current implementation of `fetch_multi` returns an array and has no
means to easily backtrack which names yielded which results. By changing
the return value to a Hash we retain the name information. Hash#values
can be used on the response if only the values are needed.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
:mem_cache_store should receive a list of hosts or a dalli client,
otherwise raise it.
Also adding a changelog.
|
|
|
|
|
|
|
| |
: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.
|
|\
| |
| |
| |
| |
| |
| |
| | |
support :unless_exist for FileCache
Conflicts:
activesupport/CHANGELOG.md
activesupport/test/caching_test.rb
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 a simple API for fetching a list of entries from the cache, where
any missing entries are computed by a supplied block.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
They don't add any benefits over `assert object.blank?`
and `assert object.present?`
|
|
|
|
| |
(active_support/dependecies.rb) (issue #8167)
|
|
|
|
| |
implentation
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This time I used ack.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
ActiveSupport::Cache::MemCacheStore
memcache-client was deprecated in favour of dalli in 2010.
|
|\
| |
| | |
#read_entry in ActiveSupport::Cache::FileStore should log details of the exception when an exception is thrown
|
| |
| |
| |
| | |
exception when an exception is thrown.
|
| | |
|
|\ \
| | |
| | | |
Fix cache (FileStore) clear to keep .gitkeep.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Reduce FILENAME_MAX_SIZE in ActiveSupport::Cache::FileStore
|
| | |/
| |/|
| | |
| | | |
In order that temp filenames generated from it will fit in 255 chars. See https://github.com/rails/rails/issues/4907
|
|/ / |
|
|/
|
|
|
|
| |
This reverts commit abe915f23777efe10f17d611bf5718ca855a0704.
This broke all existing keys and it's wrong anyway. The array is just there as a convenience option for building the string. It's intentional that [ "stuff"] and "stuff" generates the same key.
|
|
|
|
| |
minor
|
| |
|
|\
| |
| | |
Fix expanding cache key for single element arrays
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In short:
expand_cache_key(element) should not equal expand_cache_key([element])
This way a fragment cache key for an index page with only a single
element in the collection is different than a fragment cache for a
typical show page for that element.
|
|/
|
|
| |
actually caching for development and test environments.
|
| |
|
|
|
|
|
|
|
| |
(part 2)
`nil` and `false` both expand to `""` (empty string), while `true` expands to
`"true"`; `false` should expand to `"false"`
|
|
|
|
|
| |
`cache_key` method is never called when the argument is a 1-element array
with something that responds to `cache_key`
|
|
|
|
|
|
| |
value, not expecting specifically true or false
Respecting Genuine assert_equal false Edition
|
|
|
|
|
|
|
|
|
| |
return value, not expecting specifically true or false"
Reason: there were some genuine tests for false when
reading values, going to revise those ones.
This reverts commit a539a5e3f3be68f027d3dfe43f88dc9f0642c743.
|
|
|
|
| |
value, not expecting specifically true or false
|
| |
|
|
|
|
| |
method.
|