Skip to content

Commit

Permalink
fix: lower MFE config API cache timeout
Browse files Browse the repository at this point in the history
Calls to the MFE config API endpoint are made with two caches: one on
the client side, in the "edx-cache" local storage, and one on the server
side. The client side cache has a hard-coded timeout of 5 minutes. I see
no reason to have such a high cache timeout on the server side.

(cherry picked from commit bf97cae)
  • Loading branch information
regisb authored and navinkarkera committed Mar 24, 2023
1 parent 7c1fd1c commit 0420c14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
5 changes: 5 additions & 0 deletions tutormfe/patches/openedx-lms-common-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MFE: enable API and set a low cache timeout for the settings. otherwise, weird
# configuration bugs occur. Also, the view is not costly at all, and it's also cached on
# the frontend. (5 minutes, hardcoded)
ENABLE_MFE_CONFIG_API = True
MFE_CONFIG_API_CACHE_TIMEOUT = 1
4 changes: 1 addition & 3 deletions tutormfe/patches/openedx-lms-development-settings
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ CSRF_TRUSTED_ORIGINS.append("{{ MFE_HOST }}:{{ app["port"] }}")
{% endfor %}

# Start of Dynamic config API settings

ENABLE_MFE_CONFIG_API = True

# https://openedx.github.io/frontend-platform/module-Config.html
MFE_CONFIG = {
"BASE_URL": "{{ MFE_HOST }}",
"CREDENTIALS_BASE_URL": "/csrf/api/v1/token",
Expand Down
3 changes: 0 additions & 3 deletions tutormfe/patches/openedx-lms-production-settings
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ CSRF_TRUSTED_ORIGINS.append("{{ MFE_HOST }}")
ALLOWED_HOSTS.append("{{ MFE_HOST }}")

# Start of Dynamic config API settings

ENABLE_MFE_CONFIG_API = True

MFE_CONFIG = {
"BASE_URL": "{{ MFE_HOST }}",
"CREDENTIALS_BASE_URL": "/csrf/api/v1/token",
Expand Down

0 comments on commit 0420c14

Please sign in to comment.