-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf: add caching to service calls initiated from BFF #600
Conversation
LICENSE_MANAGER_CLIENT_TIMEOUT = os.environ.get('LICENSE_MANAGER_CLIENT_TIMEOUT', 45) | ||
LMS_CLIENT_TIMEOUT = os.environ.get('LMS_CLIENT_TIMEOUT', 45) | ||
ECOMMERCE_CLIENT_TIMEOUT = os.environ.get('ECOMMERCE_CLIENT_TIMEOUT', 45) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[sanity check] Are we still comfortable with 45s timeouts on service calls within our API clients? Feels a bit high, but curious how others feel about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does feel high, but I don't remember encountering any problems because of it.
|
||
ALL_ENTERPRISE_GROUP_MEMBERS_CACHE_TIMEOUT = 60 * 5 | ||
DEFAULT_CACHE_TIMEOUT = 60 * 5 # 5 minutes | ||
CONTENT_METADATA_CACHE_TIMEOUT = 60 * 30 # 30 minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[inform] Updating CONTENT_METADATA_CACHE_TIMEOUT
from 10 minutes to 30 minutes, for parity with the content metadata cache timeout in enterprise-subsidy (source).
CONTENT_METADATA_CACHE_TIMEOUT = 60 * 30 # 30 minutes | ||
ENTERPRISE_USER_RECORD_CACHE_TIMEOUT = 60 * 10 # 10 minutes | ||
SUBSIDY_AGGREGATES_CACHE_TIMEOUT = 60 * 10 # 10 minutes | ||
SUBSCRIPTION_LICENSES_LEARNER_CACHE_TIMEOUT = 60 * 2 # 2 minutes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[inform] Opted to keep the learner-licenses
cache timeout a bit smaller to reflect potentially more frequently updated data (e.g., admin-driven license assignment/revocation, etc.), as compared to enterprise customer or content metadata.
LICENSE_MANAGER_CLIENT_TIMEOUT = os.environ.get('LICENSE_MANAGER_CLIENT_TIMEOUT', 45) | ||
LMS_CLIENT_TIMEOUT = os.environ.get('LMS_CLIENT_TIMEOUT', 45) | ||
ECOMMERCE_CLIENT_TIMEOUT = os.environ.get('ECOMMERCE_CLIENT_TIMEOUT', 45) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does feel high, but I don't remember encountering any problems because of it.
e7975c7
to
be1e550
Compare
Description:
get_and_cache_subscription_licenses_for_learner
get_and_cache_default_enterprise_enrollment_intentions
get_and_cache_enterprise_course_enrollments
invalidate_subscription_licenses_cache
invalidate_default_enterprise_enrollment_intentions_cache
invalidate_enterprise_course_enrollments_cache
Jira:
ENT-9634
Merge checklist:
./manage.py makemigrations
has been runPost merge: