mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 02:59:24 +02:00
Fix #117: Use django-cacheops to cache common ORM requests
This commit is contained in:
parent
c70ab72bc0
commit
a448eaaf17
5 changed files with 15 additions and 0 deletions
|
@ -60,6 +60,7 @@ THIRD_PARTY_APPS = (
|
|||
'mptt',
|
||||
'dynamic_preferences',
|
||||
'django_filters',
|
||||
'cacheops',
|
||||
)
|
||||
|
||||
|
||||
|
@ -369,6 +370,15 @@ MUSICBRAINZ_CACHE_DURATION = env.int(
|
|||
'MUSICBRAINZ_CACHE_DURATION',
|
||||
default=300
|
||||
)
|
||||
CACHEOPS_REDIS = env('CACHE_URL', default=CACHE_DEFAULT)
|
||||
CACHEOPS_ENABLED = env.bool('CACHEOPS_ENABLED', default=True)
|
||||
CACHEOPS = {
|
||||
'music.artist': {'ops': 'all', 'timeout': 60 * 60},
|
||||
'music.album': {'ops': 'all', 'timeout': 60 * 60},
|
||||
'music.track': {'ops': 'all', 'timeout': 60 * 60},
|
||||
'music.trackfile': {'ops': 'all', 'timeout': 60 * 60},
|
||||
'taggit.tag': {'ops': 'all', 'timeout': 60 * 60},
|
||||
}
|
||||
|
||||
# Custom Admin URL, use {% url 'admin:index' %}
|
||||
ADMIN_URL = env('DJANGO_ADMIN_URL', default='^api/admin/')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue