-
Is there a way to invalidate / evict the aggressive caches? I have a scenario where I need to invalidate it occasionally (once a week) and I wanted to make sure if that chance occurs that we don't serve stale data hence I'd like to add a functionality to invalidate said caches. Atm. we're using aggressive cache on session level with defaults using var session = _documentStore.OpenAsyncSession();
await session.Advanced.DocumentStore.AggressivelyCacheAsync();
var list = await session.Query<TenantConfiguration>().ToListAsync(); Thx for your efforts! |
Beta Was this translation helpful? Give feedback.
Answered by
ayende
May 7, 2024
Replies: 1 comment 2 replies
-
I think I found the answer myself btw. would be good if someone could confirm, if that's the way to properly invalidate the caches? @ayende using var session = _documentStore.OpenAsyncSession();
session.Advanced.RequestExecutor.Cache.Clear(); |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be cheaper to do:
This will not clear the cache, but force a refresh from the server for all cached requests.
That way, if the data didn't change, you'll still get
304
reply