Delete template fragment cache

1
2
3
4
5
import hashlib
from django.core.cache import cache

def delete_template_fragment_cache(fragment_name='', *args):
    cache.delete('template.cache.%s.%s' % (fragment_name, hashlib.md5(u':'.join([arg for arg in args])).hexdigest()))

More like this

  1. Template tag to clear cached template fragment by joao.coelho 4 years, 5 months ago
  2. invalidation of cache-template-tag cache by bram 4 years, 10 months ago
  3. PK->objects in view signature by AdamKG 6 years ago
  4. MarkupField by jpt 5 years, 2 months ago
  5. very archive template by stuntgoat 4 years, 6 months ago

Comments

(Forgotten your password?)