|
|
|
|
|
by tracker1
163 days ago
|
|
I tend to write an abstraction interface, if there isn't already one, where you request a key and pass an async function/lambda that will return the value from source in case of a cache miss. var value = cache.lookup<T>(
keyname,
() => db.query<T>(...),
TimeSpan.FromMinutes(5) // or CacheOptions
);
This way it can fallback/insert on a cache miss directly... |
|