Skip to content
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

Search: add cache tags #7922

Merged
merged 3 commits into from Feb 18, 2021
Merged

Search: add cache tags #7922

merged 3 commits into from Feb 18, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Feb 16, 2021

So, there is one catch, search from the main project should be purged when one of the versions from its subprojects change (this can be done by adding one extra query when purging versions).

And... we are also losing some data from search analytics here, so not really sure if we want to cache search after all, or maybe just cache for a shorter time.

@stsewd stsewd requested a review from a team February 16, 2021 23:25
@ericholscher
Copy link
Member

I think the UX benefits of search caching are definitely better than search analytics being exact. The numbers will still be approximately correct, and if we care a lot we could send the search analytics data to an endpoint via JS, but I don't think we do :)

@stsewd
Copy link
Member Author

stsewd commented Feb 16, 2021

ok, then I'll figure out the subprojects problem, probably it will end up like the footer having an extra tag {project.slug}-rtd-search

Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, there is one catch, search from the main project should be purged when one of the versions from its subprojects change (this can be done by adding one extra query when purging versions).

Hrm, I feel like we keep hitting this issue :) Similar to the footer cache purging as well, I guess? I wonder if we can combine them into a larger framework for thinking about this.

readthedocs/api/v2/mixins.py Outdated Show resolved Hide resolved
@stsewd
Copy link
Member Author

stsewd commented Feb 18, 2021

Hrm, I feel like we keep hitting this issue :) Similar to the footer cache purging as well, I guess?

More or less, for footer we don't need to purge parent projects, but the footer from all versions. For search, we don't need to purge the search from all versions, but from the main project. I just implemented this in ext.

@stsewd stsewd merged commit c70c6e8 into master Feb 18, 2021
3 checks passed
@stsewd stsewd deleted the search-add-cache-tags branch February 18, 2021 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants