Distributed Cache
Coral has 2 implementations for ICacheService
RedisCacheService (DEV,QA,Stage,PROD)
MemCacheService (localhost)
The redis servers for the different environments are:
Redis Domain
http://redis.tests.orms.catalisgov.com
Redis Ports
Dev: 6379
Qa: 6381
Stage: 6382
Prod: 6380
Insights Dashboard: 8001 (http://redis.tests.orms.catalisgov.com:8001/)
Cluster Stats for PROD only: 8404(http://redis.tests.orms.catalisgov.com:8404/stats)
available methods
T GetOrCreate<T>(string cacheKey, Func<T> retrieveDataFunc, TimeSpan? slidingExpiration = null, bool forceRefresh = false);
void Delete(string key);
CACHING CATALOG TABLES
ICacheService Has been injected into the Generic Repository to implement the write behind pattern, therefore, it will cache the entities that Implement the ICachable interface as follows:
USAGE:
Adding ICachable to any desired custom entity under the Coral.Core will be enough.
CACHING USER UI Filter Selections by using UI Assistant Controller actions.
The UI Assistance controller has the following actions:
GetUserFilters(UserFilterRequest request)
SaveUserFilters(SaveUserFilterRequest request)
DeleteUserFilters(UserFilterRequest request)
The GET action will receive a route (ex. /transaction-by-status/pending) and will return a dictionary (key-value pairs) with the user filters for that route.
The SAVE action will receive a route (ex. /transaction-by-status/pending) and a dictionary (key-value pairs) with the user filters for that route.
The DELETE action will receive a route (ex. /transaction-by-status/pending) to clean up all the filters for that route.
The recommended approach to implement the UIAssistant controller to store the user UI selections and filters is:
Implement routes in the UI and create a site map
Get the filters for that route when page loads
Call the save/update actions when a control changes to save/update the filters or selections
Add a button in case that user wants to clean up the filters* (may require discussion with business)
Hope this helps to all of you.