Skip to content
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

Non-expiring cache keys #12327

Closed
DeathKR opened this issue Oct 16, 2016 · 5 comments
Closed

Non-expiring cache keys #12327

DeathKR opened this issue Oct 16, 2016 · 5 comments
Assignees
Labels
bug A bug report status: medium Medium
Milestone

Comments

@DeathKR
Copy link

DeathKR commented Oct 16, 2016

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
@Jurigag
Copy link
Contributor

Jurigag commented Oct 16, 2016

Because it should be more likely 0.

@DeathKR
Copy link
Author

DeathKR commented 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
Copy link
Contributor

Jurigag commented Oct 16, 2016

I checked and saving in memcache with lifetime 0 works fine.

@DeathKR
Copy link
Author

DeathKR commented Oct 16, 2016

Sorry, may be for memcached need always store ttl.

@sergeyklay sergeyklay self-assigned this Oct 16, 2016
@sergeyklay sergeyklay added this to the 3.0.3 milestone Dec 24, 2016
@sergeyklay
Copy link
Contributor

Fixed in the 3.0.x branch.

@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

4 participants