#NEWLINE# def get_cache_key( request , key_prefix = None ) : #NEWLINE# #INDENT# '\n    Returns a cache key based on the request path. It can be used in the\n    request phase because it pulls the list of headers to take into account\n    from the global path registry and uses those to build a cache key to check\n    against.\n\n    If there is no headerlist stored, the page needs to be rebuilt, so this\n    function returns None.\n    ' #NEWLINE# if ( key_prefix is None ) : #NEWLINE# #INDENT# key_prefix = settings . CACHE_MIDDLEWARE_KEY_PREFIX #NEWLINE# #UNINDENT# cache_key = ( 'views.decorators.cache.cache_header.%s.%s' % ( key_prefix , request . path ) ) #NEWLINE# headerlist = cache . get ( cache_key , None ) #NEWLINE# if ( headerlist is not None ) : #NEWLINE# #INDENT# return _generate_cache_key ( request , request , key_prefix ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return None