Expire page from cache

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from django.core.cache import cache
from django.http import HttpRequest
from django.utils.cache import get_cache_key

def expire_page(path):
    request = HttpRequest()
    request.path = path
    key = get_cache_key(request)
    if cache.has_key(key):   
        cache.delete(key)

More like this

  1. Binding signals to abstract models by andreterra 1 year ago
  2. Trigger a user password change by jedie 5 years, 8 months ago
  3. Execute a signal once by johnnoone 4 years ago
  4. SnippySnip by youell 4 years, 10 months ago
  5. Scoped Cache Compatible with Django Caching Helpers by axiak 5 years, 2 months ago

Comments

(Forgotten your password?)