title: In Django, how can we get all cache keys stored in database (MySQL)
body: <p>I am using <a href="https://docs.djangoproject.com/en/1.11/topics/cache/#the-per-view-cache" rel="nofollow noreferrer">per-view cache</a> in Django and I want to refresh the cache whenever it get's stale. In the documentation I see no information on refreshing stale cache and after going through several threads I decided to use django-signals to send a signal to a function which will delete the cache records from DB. So my problem is how do we retrieve the keys and delete it?</p>
  
  <p>I see the default implementation provides a way to give an expiration time to cache (as in @cache_page(60 * 15) and it refreshes whenever we call the view after expiration time. Is there any way to refresh stale cache not based on predefined time?</p>