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. cache_smart template tag by michiel_1981 6 years, 1 month ago
  2. New view decorator to only cache pages for anonymous users by vaughnkoch 3 years, 6 months ago
  3. Clean up expired django.contrib.session's in a huge MySQL InnoDB table by patsplat 5 years, 3 months ago
  4. MintCache by gfranxman 7 years ago
  5. Conditional cache decorator by alexisbellido 1 year, 8 months ago

Comments

(Forgotten your password?)