2

It's possible to "reset" cache during creating/updating object?

from django.views.decorators.cache import cache_page

@cache_page(60 * 15)
def index(request):
    ....
  • 1
    Please check this thread http://stackoverflow.com/questions/2268417/expire-a-view-cache-in-django – fasouto Oct 21 '13 at 13:53

1 Answers1

0

As Fasouto suggested, 1st answer on that question will solve your problem, however that wont work if you have set key_prefix in your settings file. because django pick the key_prefix while setting the cache but it dont picks from settings file while retrieving cache_key so either you provide the key_prefix while retrieving the cache key or you try removing the key_prefix from your settings file and see if that works.

Nitish Kansal
  • 478
  • 4
  • 6