-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup capabilities #8
Comments
Perhaps While we're there, the format for
Maybe the last is a bug, or maybe I'm missing something. I can see some value in being able say "yes, the adapter will store it, but won't return the same type", but Originally posted by @kynx at zendframework/zend-cache#81 (comment) |
@kynx The idea behind this is as follows:
$value = 100;
$storage->setItem('key', $value);
var_dump($value == $storage->getItem('key')); // true
var_dump($value === $storage->getItem('key')); // true
$value = new stdClass;
$storage->setItem('key', $value);
var_dump($value == $storage->getItem('key')); // true
var_dump($value === $storage->getItem('key')); // false
In case for integer it should be Originally posted by @marc-mabe at zendframework/zend-cache#81 (comment) |
Hm, I will throw my two cents in here since I do use the cache component quite frequently in almost every project I am working on. I've never used the capabilities method and thus never had a need for this. Regarding the Do we have any thoughts on this? We (in our companies projects) do use ['lib_options' => [RedisCluster::OPT_SERIALIZER => RedisCluster::SERIALIZER_IGBINARY]]; It does in fact require the I guess the supported data types can be removed and instead require components to actually handle conversion/throw exceptions. TL;DR: I have never had the need to use the supported types since these are heavily depending on the serializer being used. The |
Some of the current defined capabilities are very hard to understand/useless and I would like to define some of them.
minTtl
This defines the minimum supported TTL which is clear but only a handful people knows that this also defines the general TTL support.
There is no adapter having another value than 0 or 1 so this can be renamed to
ttlSupported
withbool
.->
minTtl
needs to be still available for BC reasons until the next major but can be marked deprecated.staticTtl
This defines how the expiration time will be calculated which is not a meaningful description.
true
means the expiration time will be calculated on read using the last-modification-time of the item, the current time and the current TTL optionfalse
means the expiration time will be calculated using the current TTL and the current time. It will be stored together with the itemThoughts for better names ?
expiredRead
There was the idea that it is possible to read an expired item by setting changing the TTL (like to 0 = infinitive) but this only works with
staticTtl=true
to make it possible using an expired item in cases regeneration breaks (like on failed DB connection).This is a useless capability because changing the TTL to something else automatically changes the expiration time of all stored items if
staticTtl=true
which means in case for infinity the item is no longer expired. -> Bam the item is no longer expired but this capability is for reading expired items and the nature ofstaticTtl
already defines this behavior.-> I would like to deprecate this capability and remove it in the next major version.
@kynx @Maks3w @Ocramius @ezimuel Thoughts ?
Originally posted by @marc-mabe at zendframework/zend-cache#81
The text was updated successfully, but these errors were encountered: