-
Notifications
You must be signed in to change notification settings - Fork 0
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
Smart caching #6
Comments
database structure:
the validate function runs daily, which revalidates any queries that have a lastValidated of > 1 month. It deletes the query from the database if it's invalid (the top Reddit results off google are different) |
I added |
Copying from the notion:project reddit(database cache)part 1async get_query_results(string query)
async get_entity(string name)
async get_thread(string url)
async set_thread(dict thread) async merge_entity(string name, optional string[] validCategories, optional string[] invalidCategories, optional description, optional imageUrl)
async store_query_to_cache(string query, string category, string[] googleResults, (entity: string, score: double)[] results)
Future ideas:
part 2every day, check if there are expired (more than 30 days) queries, and if so, check if the google results are different. If so, delete the query entry in database, otherwise simply update lastValidated to the current time Future ideas:
|
Implement smart caching of Reddit threads and such to drastically improve performance (don't forget to invalidate caches intelligently too)
Related to Caching: Have a Quick Search vs Extensive Search, where quick search only searches through and returns cached results and extensive search tries the process from the start (pulling newer Reddit comments)
The text was updated successfully, but these errors were encountered: