Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upModify cache redis backend #11608
Conversation
pantaovay
added some commits
Mar 30, 2016
This comment has been minimized.
This comment has been minimized.
See #11452 |
This comment has been minimized.
This comment has been minimized.
sergeyklay
added this to the
2.1.0 milestone
Mar 30, 2016
This comment has been minimized.
This comment has been minimized.
I'll look into this as soon as I can |
sergeyklay
reviewed
Apr 1, 2016
@@ -88,13 +99,21 @@ class Redis extends Backend implements BackendInterface | |||
} | |||
|
|||
if !isset options["statsKey"] { | |||
// Disable tracking of cached keys per default | |||
let options["statsKey"] = ""; | |||
let options["statsKey"] = "_PHCR"; |
This comment has been minimized.
This comment has been minimized.
sergeyklay
Apr 1, 2016
Member
Modify cache redis backend, delete _PHCR
As I remember it was done in pantaovay@6b88422
Why are we again added _PHCR ?
This comment has been minimized.
This comment has been minimized.
pantaovay
Apr 3, 2016
Author
Because it is inconsistent with the document. But current implementation is inconsistent with other cache backends
sergeyklay
reviewed
Apr 1, 2016
} | ||
|
||
parent::__construct(frontend, options); | ||
} | ||
|
||
public function _getRedis() |
This comment has been minimized.
This comment has been minimized.
sergeyklay
Apr 1, 2016
Member
the _
prefix is inconsistent with common style of public Phalcon methods
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sergeyklay
reviewed
Apr 1, 2016
|
||
if keyName === null { | ||
if !keyName { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
pantaovay
Apr 3, 2016
Author
All the use of keyName
in other methods is if !keyName
, I think this is inconsistent. In libmemcached
and memcache
, if keyName === null
is used in the save
method too. Maybe all of them should be if !keyName
?
This comment has been minimized.
This comment has been minimized.
pantaovay
Apr 3, 2016
Author
If user passs empty string or 0
... An empty string is not allowed but 0
should be allowed.
I think the check should be
if keyName === null || keyName === "" {
let lastKey = this->_lastKey;
} else {
let lastKey = this->_prefix . keyName;
let this->_lastKey = lastKey;
}
This comment has been minimized.
This comment has been minimized.
sergeyklay
reviewed
Apr 1, 2016
} | ||
|
||
/** | ||
* Get the key from redis | ||
*/ | ||
let keys = redis->sMembers(specialKey); | ||
let keys = this->_getRedis()->sMembers(specialKey); |
This comment has been minimized.
This comment has been minimized.
sergeyklay
Apr 1, 2016
Member
anyway
this->_getRedis()->sMembers(specialKey);
is expensive than
var redis;
let redis = this->_getRedis();
redis->sMembers(specialKey);
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
JCMais
commented
May 30, 2016
Is that PR still being worked on? |
sergeyklay
removed this from the
2.1.0 milestone
Jun 16, 2016
andresgutierrez
added
the
Requires-Discussion
label
Jun 20, 2016
This comment has been minimized.
This comment has been minimized.
tigran-a
commented
Jul 1, 2016
Hi, just to let you know, this _PHCR is a pain for us, it eats all the memory from our Redis: the keys are stored with TTL, so after they expire, redis removes it, but _PHCR keeps growing regardless if the keys exist or not (there is no explicit key removal from php, we rely on TTL). Why not to modify all cache backends that they'd interpret null value as not to use the stats key? |
This comment has been minimized.
This comment has been minimized.
tigran-a
commented
Jul 1, 2016
Sorry for using a language that is not related to the project, but this what we have to run from time to time to clean up that key without affecting the production, maybe it might be useful for someone else:
|
This comment has been minimized.
This comment has been minimized.
wcoppens
commented
Jul 11, 2016
Just to let you know, the _PHCR prefix really is annoying. We for instance use the redis cache across multiple applications. Phalcon in our case created the redis cache data since it acts as a receiver of measurement data. In Phalcon 1.x with the incubator package we did not have the prefix behavior and so all the cached data in Redis is not prefixed. However since we can't stay legacy we are forced to upgrade resulting in upgrading our whole application stack to support the prefix... It would really help us if there would come a solution in which the key is optional. |
sjinks
closed this
Apr 26, 2017
sjinks
reopened this
Apr 26, 2017
This comment has been minimized.
This comment has been minimized.
aat2703
commented
Mar 7, 2018
Will this be added to 3.3.3? Really Looking forward to it |
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Oct 31, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Nov 1, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Nov 1, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Nov 1, 2018
added a commit
to niden/cphalcon
that referenced
this pull request
Nov 1, 2018
This comment has been minimized.
This comment has been minimized.
Closing in favor of #13563 |
pantaovay commentedMar 30, 2016
Changes
set
method supportsttl
,the call ofsettimeout
is removedexists
method to check if a key exists, the previous implementation usesget
which is wrongWhy
_PHCR
will cause it expands quickly and this will influence performance.statsKey
andprefix
, it uses_PHCR
as super prefix which is not needed.