django中缓存设置参数
在settings.py中的CACHES内配置缓存参数

CACHES = {
     'default':
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',     
        'LOCATION': '/var/tmp/django_cache',
        'TIMEOUT': 60
        'OPTIONS': {
             'MAX_ENTRIES': 1000 
        } 
    }
}

参数列表:
TIMEOUT    #过期时间,s计数,默认5min
OPTIONS    #
    MAX_ENTRIES    #缓存中存放的最大条目数
    CULL_REQUENCY    #当达到 max_entries 的时候,被接受的访问的比率。实际的比率是1/cull_frequency, cull_frequency 的值设置为 0 意味着当达到 max_entries 时,缓存将被清空。这将以很多缓存丢失为代价,大大提高接受访问的速度。这个值默认是3
KEY_PREFIX    #缓存前缀
VERSION
KEY_FUNCTION

shop

Some observers agree that teachers’ voices were glaringly absent during its passage The https://www.trymobilespy.com/ dots you connect will disappear, the rest will fall down, and new ones will drop in at the top

标签: ,
本文连接地址: http://www.fresker.com/archives/559 (转载注明出处)

回复

目前暂无评论

Sorry, 评论已关闭.