Hello! Is it possible somehow to invalidate the c...
# community-help
s
Hello! Is it possible somehow to invalidate the cache manually?
k
Yes you can:
Copy code
POST /operations/cache/clear
s
Thank you!
Hmm, we are trying to use the
Client
from
typesense
npm package. The thing is that w r executing
Copy code
client.collections(index).documents().clearCache()
and the next search request is receiving the cached version 😞 c @Jason Bosco @Kishore Nallan
I see an update in Typesense Cloud immediately, but when I am requesting my back-end -> I still need to wait cos the request is the same and looks like the cache was not invalidated
j
The method call above only clears the client-library-side cache. To clear the server-side cache, you want to call in addition:
Copy code
client.operations().perform('cache/clear')
s
thank you! lemme try
@Jason Bosco looks like it did not help 😞 I am doing
Copy code
await this.client.operations.perform('cache/clear');
after importing the docs
Copy code
await this.client.collections(index).documents().import(data, { action: 'update' });
my client config is
Copy code
useServerSideSearchCache: true,
cacheSearchResultsForSeconds: 60,
and the search method is using
Copy code
use_cache: true,
even if i send the POST request manually using postman after the updates - still does not work 😞 Either I should wait or change the search request - then it works
j
May I know which Typesense Server version you’re on?
s
0.24.1
And we are using Typesense Cloud
j
Hmmm, could you open a GitHub issue with a set of curl commands like this and each command’s output, that replicates the issue? We can then dig into it further?
s
Absolutely, would do