![]() ![]() Here is the code: public T ApiCachi(Func act, int minutes = 10) where T : class I could not find any reference where ReadThrough() is async. The issue I am facing is that page controller can call API endpoints async while blocks call sync. Now I have created a service class which I inject in Controllers. ![]() Return objectCaching.ReadThrough(objectCaching.GenerateCacheKey(authPersister.GetCacheKey()),ĬacheTimeoutType.Absolute), ReadStrategy.Wait) Tak på forhånd protected T APICaching(Func act, ISynchronizedObjectInstanceCache objectCaching, IAuthPersister authPersister) where T : class If the user sign out should the caching be invalidated or its ok to let it be as 10 minutes will expire the caching. Should this key be dependent on Masterkey, so If i want to remove cached object i can do so by master key ? I am gernerating cache key for each cache object by setting masterkey(unique) with object name. The other question is som API endpoints can be cached for 10 or more minutes, while others for 2-3 minutes (data can be changed quickly), should I created method overload with different CacheEvicationPolicy. Where should the method be residing, as right now I am sending all the arguemnts from Controller as they are being inject there through DI. Right now i have implemented methods in base controllers of both page & block. We have three different types of classes which are calling API endpoints, blockcontrollers,pagecontrollers,VisitorGroups Criteria for pages/blocks. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |