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. Technical 500 by group membership by jdunck 2 years, 8 months ago
  2. MintCache by gfranxman 5 years, 1 month ago
  3. More information about users and groups in user admin by ramusus 2 years, 10 months ago
  4. group_required decorator by msanders 2 years, 9 months ago
  5. New view decorator to only cache pages for anonymous users by vaughnkoch 1 year, 7 months ago

Comments

(Forgotten your password?)