{"action":"closed","issue":{"url":"https://api.github.com/repos/niwinz/django-redis/issues/178","repository_url":"https://api.github.com/repos/niwinz/django-redis","labels_url":"https://api.github.com/repos/niwinz/django-redis/issues/178/labels{/name}","comments_url":"https://api.github.com/repos/niwinz/django-redis/issues/178/comments","events_url":"https://api.github.com/repos/niwinz/django-redis/issues/178/events","html_url":"https://github.com/niwinz/django-redis/issues/178","id":131583974,"number":178,"title":"cache_page function key_prefix doesn't play nicely with cache.keys or cache.delete_pattern","user":{"login":"squarebraces","id":7247329,"avatar_url":"https://avatars.githubusercontent.com/u/7247329?v=3","gravatar_id":"","url":"https://api.github.com/users/squarebraces","html_url":"https://github.com/squarebraces","followers_url":"https://api.github.com/users/squarebraces/followers","following_url":"https://api.github.com/users/squarebraces/following{/other_user}","gists_url":"https://api.github.com/users/squarebraces/gists{/gist_id}","starred_url":"https://api.github.com/users/squarebraces/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/squarebraces/subscriptions","organizations_url":"https://api.github.com/users/squarebraces/orgs","repos_url":"https://api.github.com/users/squarebraces/repos","events_url":"https://api.github.com/users/squarebraces/events{/privacy}","received_events_url":"https://api.github.com/users/squarebraces/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-05T08:26:28Z","updated_at":"2016-04-12T06:20:03Z","closed_at":"2016-04-12T06:20:03Z","body":"I understand that version number is inserted before the key as a prefix by django-redis. The problem is that this is prefixed 'before' django prefixes it with the key_prefix specified in the cache_page function.\r\n\r\nFor eg:\r\n1. Doing @cache_page(timeout) will generate a key of the form - \":1:views.decorators.cache....\"\r\n-  django-redis keys() and delete_pattern() will respond to the expression \"views*\",  silently abstracting the version prefix.\r\n\r\n2. Doing @cache_page(timeout, key_prefix=\"myprefix\") generates a key of the form \"myprefix:1:views.decorators.cache...\"\r\n-  django-redis keys() and delete_pattern() are not able to find these keys at all.\r\n\r\nWe want to use the key_prefix attribute of the cache_page function to selectively scan and delete keys using the command delete_pattern(\"myprefix*\")\r\n\r\nIs there a workaround short of interacting with the raw connection? We are still using Django 1.6.5 and don't know if this is actually a bug in Django.\r\n\r\nPS: apologies for opening an empty issue earlier - typo ended up sending enter."}}