Skip to content

Commit 2b3fa03

Browse files
Filebased footer file cache
1 parent 98a7ff1 commit 2b3fa03

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

readthedocs/api/v2/views/footer_views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
highest_version,
1818
parse_version_failsafe,
1919
)
20-
20+
from django.core.cache import get_cache, cache
21+
footer_cache = get_cache('footer')
22+
default_cache = get_cache('default')
2123

2224
def get_version_compare_data(project, base_version=None):
2325
"""

readthedocs/settings/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ def USE_PROMOS(self): # noqa
267267
'default': {
268268
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
269269
'PREFIX': 'docs',
270+
},
271+
'footer': {
272+
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
273+
'LOCATION': os.path.join(SITE_ROOT, 'readthedocs', 'api/v2/templates/restapi/footer.html' )
270274
}
271275
}
272276
CACHE_MIDDLEWARE_SECONDS = 60

0 commit comments

Comments
 (0)