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
- Using descriptors for lazy attribute caching by djypsy 5 years, 9 months ago
- Decorator to modify reverse() to render SSL urls by AndrewIngram 4 years ago
- Delete View by alcides 4 years, 10 months ago
- fast table flush without raw SQL by dsblank 3 years, 5 months ago
- Type checking templatetag filters by marcorogers 3 years, 3 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
#