-
Notifications
You must be signed in to change notification settings - Fork 15
Fallbacks, automatic/general invalidation, Redis Optimizations, IScopedCache #43
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
Fallbacks, automatic/general invalidation, Redis Optimizations, IScopedCache #43
Conversation
and removed duplicated tests and cleanups
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Danny,
I had a design review and partial code review by Roni and his team
and Zoar reviewed the unit tests
I've made some changes per your request, please check again and let me know what you think.
Thanks,
Avi
- Warning on invalid input in headers o In addition, now demoting to CacheMethod.None instead of just removing CacheMethod.Get - Rename – InvalidateLevel1OnLevel2Update InvalidateLevel1OnLevel2Upsert o Fix – LayeredScopedCache constructor regarding level1notifier initialization (copy fix from LayeredCache) - Add IgnoreMinimumValueTimestamp (0b_0001_0000) to CacheMethod - Change GeneralInvalidation channel message to be used as CacheName Regex (.* for all, sc(\d*)_notificationHub_.+ for all NotificationHubDomain, …) - Swagger helper for Core - Some refactoring (IsValid, IsInScope, …)
SyncProvider Failure Policy and LayeredScoped TryGet
@AwMalka Adding to a public interface is effectively a breaking change (one interface changed for instance is I'm still going through the changes, but in general - anywhere you have a change to a public interface (and/or class for that mater) - update major version (version, file version and assembly version). If there are no changes to a public interface -> only update version and file version and leave assembly version as is |
RedisNotifier
InMemory
LayeredCache
whenever Level2.Set is invoked (including Get(key, getter))
automatically publish CacheItemActionTypes.Updated
RedisClient
3 new cache types: that relies on the new CacheDirectives
CacheableActionFilterAttribute (WebApiExtended/WebApiExtended.NETCore)
for automatically setting CacheDirectives on scope web api actions
Using the new CacheDirectives, the consumer is able to effect cache method used (None/Get/Set/GetOrSet) and to specify the acceptable response age based on its own specific BL (using MinimumValueTimestamp)
Use cases for example:
Service A provides CustomerDetails
Service B needs CustomerDetails.RegistrationDate which doesn't change over time so cache result is always accepted
Service C has a BL which can accept CustomerDetails retrieved in the last 30 minutes
Service D has a BL which can accept CustomerDetails retrieved at least after a specific timestamp
Service E BL requires up-to-date CustomerDetails (no-cache)
by using CacheableActionFilterAttribute and *ScopedCache defined with slidingExpiration of 30 minutes we can serve all listed above easily and safely using a single endpoint in Service A
as a bonus, it makes it easier to retrieve data from replicated datasources while taking into consideration replication lags by relying on ValueTimestamp/MinimumValueTimestamp and GetScoped/SetScoped added functionalities