Conversation
aa51110 to
61d1941
Compare
d8dd7b0 to
1f43c3c
Compare
shanbady
approved these changes
Feb 3, 2026
Contributor
shanbady
left a comment
There was a problem hiding this comment.
works as intended. leaving my approve here. 👍
aaaf088 to
5f61b30
Compare
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Partially addresses https://github.com/mitodl/hq/issues/5101
Description (What does it do?)
user_list_parentsandlearning_path_parentsfrom learning_resources_search and learning_resources serializers. I kept those fields in the serializers as empty lists to maintain backwards API compatibility. The frontend is making separate API calls to get the required data for these now.dfs_query_then_fetchonly when there is aqparameter, with default sorting.has_childopensearch subquery ifcontent_file_score_weightis 0 (but it typically is not).How can this be tested?
Same cache for all users
main branch
docker compose exec redis redis-cli -n 4 FLUSHDBto clear all view cachesdocker compose exec redis redis-cli -n 4 KEYS ":1:views.decorators.cache.cache_page.search.GET*"to verify there are no cache keysthis branch
Run
docker compose exec redis redis-cli -n 4 FLUSHDBto clear all view cachesRun
docker compose exec redis redis-cli -n 4 KEYS ":1:views.decorators.cache.cache_page.search.GET*"to verify there are no cache keysLog in as an authenticated user and go to http://open.odl.local:8065/api/v1/learning_resources_search/?q=biological
Check the redis cache keys again, you should see something like this:
Log in as another user in an incognito tab or other browser, and go to http://open.odl.local:8065/api/v1/learning_resources_search/?q=biological
Check the redis cache keys again, it should be the same as before, no additional keys.
You can repeat the above with an anonmyous user, there should still be no additional keys.
For each logged in user, go to the search page, add some courses to your Favorites (and learning paths if an admin), refresh the page. Each user should see their own favorite courses marked as such.
As an admin, go to http://open.odl.local:8062/learningpaths. You should still be able to see your learning paths, the list of resources in each, etc.
As an admin, go to http://open.odl.local:8065/api/v1/articles - you should see both published and unpublished articles (create some of each if you don't have any at http://open.odl.local:8062/articles/new/
As an anon user or other non-admin user, go to the same url above, you should only see published articles.
Performance Testing
You can use Locust for this. View the README under the
load_testingfolder to get it up & running. To test with the same user, check "Authenticated User" near the top, and under "Custom Options", copy the value of "sessionid" from your browser cookie.compared to main (copy the locustfile.py and uwsgi changes there for a fair comparison):
Additional Context
I think
SessionMiddlewareis responsible for adding theVary: Cookieheader everywhere based on what I read online. Seemed easier to create a custom caching function to ignore that than mess around with the middleware, but I can be persuaded otherwise.@rhysyngsun would you mind taking a glance at this as a sanity check? Particularly the custom caching function to ensure all users hit the same cache