/
Distributed Cache

Distributed Cache

Coral has 2 implementations for ICacheService

  1. RedisCacheService (DEV,QA,Stage,PROD)

  2. MemCacheService (localhost)

 

The redis servers for the different environments are:

Redis Domain
http://redis.tests.orms.catalisgov.com

Redis Ports

 

image-20240624-162219.png

 

 

image-20240624-162243.png

 

 

available methods

  1. T GetOrCreate<T>(string cacheKey, Func<T> retrieveDataFunc, TimeSpan? slidingExpiration = null, bool forceRefresh = false);

  2. 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:

 

image-20240624-160708.png

 

USAGE:

Adding ICachable to any desired custom entity under the Coral.Core will be enough.

 

image-20240624-160809.png

 

 

CACHING USER UI Filter Selections by using UI Assistant Controller actions.

The UI Assistance controller has the following actions:

  1. GetUserFilters(UserFilterRequest request)

  2. SaveUserFilters(SaveUserFilterRequest request)

  3. 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:

  1. Implement routes in the UI and create a site map

  2. Get the filters for that route when page loads

  3. Call the save/update actions when a control changes to save/update the filters or selections

  4. 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.

Add label

Related content