Created
October 24, 2012 08:31
-
-
Save esisa/3944837 to your computer and use it in GitHub Desktop.
Clear a elevation profile cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
# Cache location set to file | |
CACHES = { | |
'default': { | |
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', | |
'LOCATION': '/tmp/waymarkedtrails-cache', | |
} | |
} | |
settings.configure(CACHES=CACHES) | |
from django.core.cache import cache | |
from django.http import HttpRequest | |
from django.utils.cache import get_cache_key | |
from django.core.urlresolvers import reverse | |
def expire_page(relation_id): | |
jsonRequest = HttpRequest() | |
jsonRequest.path = "/en/routebrowser/305572/profile/json" | |
key = get_cache_key(jsonRequest) | |
print key | |
if cache.has_key(key): | |
cache.delete(key) | |
#expire_page(305572) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment