diff --git a/lms/envs/common.py b/lms/envs/common.py index f6d77d904ba9..888abbacea49 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -4872,6 +4872,12 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring ENABLE_AUTHN_LOGIN_BLOCK_HIBP_POLICY = False HIBP_LOGIN_BLOCK_PASSWORD_FREQUENCY_THRESHOLD = 5 +# .. setting_name: MFE_CONFIG_API_CACHE_TIMEOUT +# .. setting_default: 60*5 +# .. setting_description: The MFE_CONFIG site configuration will be cached during the +# specified time +MFE_CONFIG_API_CACHE_TIMEOUT = 60*5 + ############### Settings for the ace_common plugin ################# ACE_ENABLED_CHANNELS = ['django_email'] ACE_ENABLED_POLICIES = ['bulk_email_optout'] diff --git a/openedx/core/djangoapps/mfe_api/views.py b/openedx/core/djangoapps/mfe_api/views.py index 6cd15d3c84a7..c046bb2c509a 100644 --- a/openedx/core/djangoapps/mfe_api/views.py +++ b/openedx/core/djangoapps/mfe_api/views.py @@ -1,3 +1,7 @@ +from django.conf import settings +from django.utils.decorators import method_decorator +from django.views.decorators.cache import cache_page + from rest_framework.response import Response from rest_framework.views import APIView @@ -9,6 +13,7 @@ class MFEConfigView(APIView): Provides an API endpoint for MFE config from site configurations. """ + @method_decorator(cache_page(settings.MFE_CONFIG_API_CACHE_TIMEOUT)) def get(self, request): """ GET /api/mfe/v1/config