Closed
Description
Can't set a non-expiring keys in Redis. Lifetime =-1 does not help.
Expected and Actual Behavior
Phalcon always send to redis EXPIRE command:
1476660660.879090 [0 127.0.0.1:58788] "EXPIRE" "_PHCRmykey" "-1"
$frontCache = new FrontData(['lifetime' => -1]);
$cache = new Redis($frontCache, [
'host' => 'localhost',
'port' => 6379,
'persistent' => true,
'index' => 0
]);
$cache->save("mykey", 1000);
Always set expire to 1 second:
$frontCache = new FrontData();Also this does not help
$cache->save("mykey", 1000, -1);
Details
- Phalcon version: 3.0.1
- PHP Version: PHP 7.0.11-1~dotdeb+8.1 (cli) ( NTS )
- Operating System: Debian
- Installation type: Compiling from source
- Zephir version (if any): Version 0.9.4a-dev-7e304ba18c
- Server: Nginx
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
No branches or pull requests
Activity
Jurigag commentedon Oct 16, 2016
Because it should be more likely 0.
DeathKR commentedon Oct 16, 2016
With '0' keys expire at once. I can set 10 years, but it's not solution. I dont't want to Redis was constantly checking the keys that should be always. This is unnecessary CPU operation.
Jurigag commentedon Oct 16, 2016
I checked and saving in memcache with lifetime 0 works fine.
DeathKR commentedon Oct 16, 2016
Sorry, may be for memcached need always store ttl.
sergeyklay commentedon Dec 24, 2016
Fixed in the
3.0.x
branch.