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, 4 months ago
  2. MintCache by gfranxman 4 years, 10 months ago
  3. More information about users and groups in user admin by ramusus 2 years, 6 months ago
  4. New view decorator to only cache pages for anonymous users by vaughnkoch 1 year, 3 months ago
  5. Scoped Cache Compatible with Django Caching Helpers by axiak 3 years, 11 months ago

Comments

(Forgotten your password?)