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

refresh/invalidate cache button #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

remil1000
Copy link

Hello

we're currently spawning the korap/kalamar/kustvakt stack on demand for our internal needs, with the frontend and backend colocated on the same hardware, running as containers.

I'm still unsure how (timeout, empty response, 500 from backend) but in some cases, when a query is done before kustvakt has finished its startup and warmup, we have cases where a invalid response is cached and we can't query this particular term anymore without getting an empty result from cache

This PR is an attempt at adding a simple "refresh" checkbox to invalidate the cache on a query (which could probably also be useful if the backend index is updated without a frontend restart)

PS: I don't really understand the i18n mechanism used so feel free to fix this in the template file

@Akron
Copy link
Member

Akron commented Apr 2, 2024

Many thanks for this contribution!

In principle, I have nothing against the inclusion of the feature, but it should be optionally integrated via configuration and not be automatically available for all instances. If you want, I can add a draft to this commit and also integrate the localization accordingly.

However, Kalamar should not cache invalid values that result from incorrect or incomplete responses from the backend, so it would be nice if you could report the error as an issue as soon as it is reproducible. The best way to delete the entire cache as soon as new data has been added to the index is to use

perl script/kalamar chi clear

(or the corresponding command for the running Docker container) as a restart doesn't clear the cache in case it is persistent. Admittedly, this is not well documented.

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