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

🐛 Redis does not invalidate cached search results #599

Merged
merged 5 commits into from
Sep 4, 2024

Conversation

neon-mmd
Copy link
Owner

@neon-mmd neon-mmd commented Sep 2, 2024

What does this PR do?

This PR fixes the issue regarding cached search results not invalidating in the redis server by reimplementing the caching code in search function and replacing the deprecated set_ex function with set_options function.

Why is this change important?

This change is essential because it fixes the issue regarding cache invalidation in redis server which if not dealt properly can cause cached results to never get invalidated and very old results to be provided to the users which can really provide a bad user experience.

How to test this PR locally?

It can be tested by installing and running Websurfx as mentioned in the docs and on the readme and by launching the browser and thoroughly testing. By checking one of the cached search results's ttl by requesting the same search query a couple of times. This can be done by running the following commands:

Connect a redis debugging client to the current server:

redis-cli -p <port on which the server is running>

Fetch one of the cached search result:

Key *

Checking the cached search result's ttl:

tll <paste one of the keys copied from the above command as string>

Author's checklist

  • Reimplement the caching code in the search function.
  • Replace the deprecated set_ex function with set_options function.
  • Bump the app version to v1.17.20.

Related issues

Closes #592

@neon-mmd neon-mmd changed the title 🐛 redis does not invalidate cached search results 🐛 Redis does not invalidate cached search results Sep 2, 2024
Copy link
Collaborator

@alamin655 alamin655 left a comment

Choose a reason for hiding this comment

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

Approved! Let's merge this in. 👍

@alamin655 alamin655 merged commit 948d20d into rolling Sep 4, 2024
8 checks passed
@alamin655 alamin655 deleted the FIX/592_redis-does-not-invalidate-cached-results branch September 4, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Redis does not invalidate cached results
2 participants