1 2 3 4 5 6 7 8 9 10 | from django.conf import settings
from django.core.cache import cache
from django.utils.encoding import iri_to_uri
def delete_url_cache(url):
""" simple method to delete the cache for a particular URL """
key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX
cache_key = 'views.decorators.cache.cache_header.%s.%s' % (key_prefix,
iri_to_uri(url))
cache.delete(cache_key)
|
More like this
- Get the Django decorator/middleware cache key for given URL by s29 3 months ago
- Delete python compiled files (*.pyc) by kogakure 3 years, 6 months ago
- Using class methods as views by panyam 2 years, 7 months ago
- fast table flush without raw SQL by dsblank 2 years, 1 month ago
- Clear Django Cache by girasquid 3 years, 4 months ago
Comments
Duplicate of http://www.djangosnippets.org/snippets/936/
#
oops, it certainly is.. my mistake not seeing if anything had been submitted since last time i checked
#