{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/8296","repository_url":"https://api.github.com/repos/cakephp/cakephp","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/8296/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/8296/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/8296/events","html_url":"https://github.com/cakephp/cakephp/issues/8296","id":135030804,"number":8296,"title":"RedisEngine clearGroup doesn't seem to do anything related to clearing a group of keys","user":{"login":"chrisjohnson","id":178144,"avatar_url":"https://avatars.githubusercontent.com/u/178144?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisjohnson","html_url":"https://github.com/chrisjohnson","followers_url":"https://api.github.com/users/chrisjohnson/followers","following_url":"https://api.github.com/users/chrisjohnson/following{/other_user}","gists_url":"https://api.github.com/users/chrisjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisjohnson/subscriptions","organizations_url":"https://api.github.com/users/chrisjohnson/orgs","repos_url":"https://api.github.com/users/chrisjohnson/repos","events_url":"https://api.github.com/users/chrisjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisjohnson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/cache","name":"cache","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/79","html_url":"https://github.com/cakephp/cakephp/milestones/3.2.3","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/79/labels","id":1579024,"number":79,"title":"3.2.3","description":"Bugfixes and minor enhancements for 3.2.x","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":36,"closed_issues":42,"state":"open","created_at":"2016-02-12T03:23:02Z","updated_at":"2016-02-20T04:49:14Z","due_on":"2016-02-28T05:00:00Z","closed_at":null},"comments":3,"created_at":"2016-02-20T04:24:17Z","updated_at":"2016-02-20T04:57:44Z","closed_at":null,"body":"Perhaps I am misunderstanding how cache engines are supposed to work. So let me start there.\r\n\r\nI have a cache config created called 'short', it uses the Redis engine and there are no groups defined in the config.\r\n\r\nI create a bunch of Cache entries as such: `Cache::write('foo_bar_123456', $data, 'short');`\r\n\r\nI run `Cache::clearGroup('foo_bar', 'short');`, and I would expect it to do something roughly equivalent to this command: `redis-cli KEYS \"foo_bar*\" | xargs -n 100 redis-cli DEL`, only in PHP code.\r\n\r\nHowever, I go to inspect the source code for RedisEngine::clearGroup, and it finds a key called 'foo_bar', and increments its value. It does nothing else. I issue a `KEYS foo_bar*` command and I see not only the keys I created via `Cache::write` but the new foo_bar key.\r\n\r\nIs there some redis concept or group concept that I am missing here? The docs make clearGroup sound like it's for deleting a bunch of grouped keys, but the implementation here doesn't seem to match that. "},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/186510612","html_url":"https://github.com/cakephp/cakephp/issues/8296#issuecomment-186510612","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/8296","id":186510612,"user":{"login":"chrisjohnson","id":178144,"avatar_url":"https://avatars.githubusercontent.com/u/178144?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisjohnson","html_url":"https://github.com/chrisjohnson","followers_url":"https://api.github.com/users/chrisjohnson/followers","following_url":"https://api.github.com/users/chrisjohnson/following{/other_user}","gists_url":"https://api.github.com/users/chrisjohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisjohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisjohnson/subscriptions","organizations_url":"https://api.github.com/users/chrisjohnson/orgs","repos_url":"https://api.github.com/users/chrisjohnson/repos","events_url":"https://api.github.com/users/chrisjohnson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisjohnson/received_events","type":"User","site_admin":false},"created_at":"2016-02-20T04:57:44Z","updated_at":"2016-02-20T04:57:44Z","body":"Ok, can you explain a bit more on how the groups are meant to work then? Because I read through the entire RedisEngine file and the only other mention of group is in the function 'groups'. There is nothing else that reads, writes, or deletes based on the group in the file.\r\n\r\nAnd even if we're pre-defining groups, I don't see how the current body of clearGroup actually does what it advertises, which is delete a bunch of keys that are in the given group. The current body of clearGroup is:\r\n\r\n```\r\nreturn (bool)$this->_Redis->incr($this->settings['prefix'] . $group);\r\n```"}}