-
Notifications
You must be signed in to change notification settings - Fork 372
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 full search results. #4382
Conversation
c4dee7c
to
677047c
Compare
'show_enterprise=' + str(show_enterprise), | ||
'start=' + str(start), | ||
'num=' + str(num), | ||
'name_only=' + str(name_only), |
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.
Note: we only cache name_only queries for now. This part of the key is optional
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.
I think it is best to include it, just in case we decide to broaden what we cache.
* Cache full search results. * Addressed review comments.
As we chatted about, this adds redis caching of full search results.
In this PR:
process_query_using_cache()
that wraps around aroundprocess_query()
, and some helper functions to decide which queries are cacheable.rediscache.delete_keys_with_prefix()
should take a prefix string rather than a pattern. This better fits the name of the function and the way that that it was being used.