-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Cache: purge rtd-addons
when a new version is enabled & built
#11489
base: main
Are you sure you want to change the base?
Conversation
Note that I wasn't able to write a test case because `readthedocsext` is not installed in our test suite, so I cannot check this task is called. Closes #11291
This comment was marked as off-topic.
This comment was marked as off-topic.
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.
This is purging all responses from addons, we want to purge only the response from a given project/version.
You may want to add this at https://github.com/readthedocs/readthedocs-ext/blob/main/readthedocsext/cdn/providers/base.py#L66-L69 instead.
…hedocs/readthedocs.org into humitos/purge-addons-version-built
…mitos/purge-addons-version-built
Good point! I added the
|
This should be in rtd-ext, where we already have all the purging logic for all cases (old flyout). |
I don't follow you. How do you want to call the purge logic from .org? What function/method in particular? |
We already call the purge method from .org (using a signal), you just need to add the tag in rtd-ext. |
What signal? I think you need to be more explicit here if you want me to follow you. |
You just need to add the new tag in https://github.com/readthedocs/readthedocs-ext/blob/main/readthedocsext/cdn/providers/base.py#L66-L69, we already call that purge method from .org when needed. |
Well, that's my point. We are not calling the purge method from .org when needed. We need to purge the cache after a version is enabled and built. That's not currently happening. BTW, you didn't answer my previous question: "What signal?" |
We are, that's how the old flyout is purged. readthedocs.org/readthedocs/projects/tasks/search.py Lines 236 to 241 in dc8c965
|
I don't want to purge the addons endpoint every time a file is changed in a version. |
That signal is triggered when a version is built. |
It's the same. I don't want to purge the endpoint every time a version is built. I only want it when it was just enabled and built. That means, the first time the version is built after being enabled. |
Your current call is purging the cache on every build |
You still want to purge the cache on every build, if files changed, FTD needs to return a fresh response. |
No. It only call the purge when the version was not built previously and now is built.
You are trying to solve a different problem here, and it's outside the scope of this PR. File Tree Diff only works on PR builds for now and we use a different approach there. |
There are more cases where we are serving stale information from addons, get_version_cache_tags already covers all those cases (a new translation is another case). Here we are trying to solve a very specific case instead of the general one (which was already solved for the old flyout). |
That's a good argument. You could have started there. However, that's a completely different conversation. We will be switching from purging the cache "once in a while" (in very specific situations) to "on every build" which is a bigger change here. I'm happy to discuss that, but that's out the scope of this PR definitely. The response for the old flyout had a lot less data than addons, so we may want to be caution here with when we are purging the cache. |
Note that I wasn't able to write a test case because
readthedocsext
is not installed in our test suite, so I cannot check this task is called.Closes #11291