def get_url_cache_key(url, language=None, key_prefix=None):
    if key_prefix is None:
        key_prefix = getattr(settings, 'CACHE_MIDDLEWARE_KEY_PREFIX', None)
    ctx = hashlib.md5()
    path = hashlib.md5(iri_to_uri(url))
    cache_key = 'views.decorators.cache.cache_page.%s.%s.%s.%s' % (
        key_prefix, 'GET', path.hexdigest(), ctx.hexdigest()
    )
    if language:
        cache_key += '.%s' % language
    return cache_key
modified version of http://djangosnippets.org/snippets/2595/
dataset/ETHPy150Open mozilla/source/source/utils/caching.py/get_url_cache_key