(path, servername, serverport, key_prefix=None)
return False
刷新视图缓存
    :param path:url路径
    :param servername:host
    :param serverport:端口
    :param key_prefix:前缀
    :return:是否成功
刷新视图缓存
    :param path:url路径
    :param servername:host
    :param serverport:端口
    :param key_prefix:前缀
    :return:是否成功
刷新视图缓存 : param path : url路径 : param servername : host : param serverport : 端口 : param key_prefix : 前缀 : return : 是否成功
def expire_view_cache(path, servername, serverport, key_prefix=None):
    '''
    刷新视图缓存
    :param path:url路径
    :param servername:host
    :param serverport:端口
    :param key_prefix:前缀
    :return:是否成功
    '''
    from django.http import HttpRequest
    from django.utils.cache import get_cache_key

    request = HttpRequest()
    request.META = {'SERVER_NAME': servername, 'SERVER_PORT': serverport}
    request.path = path

    key = get_cache_key(request, key_prefix=key_prefix, cache=cache)
    if key:
        logger.info('expire_view_cache:get key:{path}'.format(path=path))
        if cache.get(key):
            cache.delete(key)
        return True
    return False
def expire_view_cache ( path , servername , serverport , key_prefix = None ) : from django . http import HttpRequest from django . utils . cache import get_cache_key request = HttpRequest ( ) request . META = { 'SERVER_NAME' : servername , 'SERVER_PORT' : serverport } request . path = path key = get_cache_key ( request , key_prefix = key_prefix , cache = cache ) if key : logger . info ( 'expire_view_cache:get key:{path}' . format ( path = path ) ) if cache . get ( key ) : cache . delete ( key ) return True return False