-
Notifications
You must be signed in to change notification settings - Fork 719
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
Fix caching issues for remote content API calls #11464
Fix caching issues for remote content API calls #11464
Conversation
Prevent django middleware from caching requests.
8347565
to
d80a2a8
Compare
It looks like I am still able to replicate the 410s by following #11457 replication steps. Maybe rebasing to include #11459 (review) changes could prove beneficial? 410s.mov |
Build Artifacts
|
Ugh - no, this seems to be that in spite of refusing to use disk cache for other requests, browsers are very happy to use the disk cache for the 410 response! I'll patch the response headers in this case to prevent caching. |
@akolson I've made one more update to ensure that we add never cache headers to non-200 responses as well, so that browsers are never tempted to cache them! |
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.
Changes look correct and also seem to fix the issue reported. Tagging @radinamatic @pcenov for more manual QA. Thanks @rtibbles
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.
LGTM as well, no caching issues observed while manually testing.
848873a
into
learningequality:release-v0.16.x
Summary
References
Fixes #11457
Reviewer guidance
Load e.g. http://127.0.0.1:8000/api/public/v2/contentnode_tree/d6e3b856125f5e6aa5fb40c8b112d5e9/?format=json and check that refreshes result in a 304 immediately
Likewise for access to remote URLs, such as http://localhost:8000/api/content/contentnode_tree/d6e3b856125f5e6aa5fb40c8b112d5e9/?include_coach_content=true&baseurl=https%3A%2F%2Fstudio.learningequality.org&format=json
Also follow the steps outlined in the issue to ensure that 410s are not being cached.
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)