Is there a way to globally include current sessionid in the cached response keys? We are allowing user impersonation but the cached response(s) are being returned for content returned for the user before the impersonation happens.
Is the best option to remove the CachedResponseAttribute and manually manage it ourselves, something like below?
var cacheKey = "unique_key_for_this_request"; //maybe SessionID + ResponsDtoType?
return base.Request.ToOptimizedResultUsingCache(base.Cache,cacheKey,()=>
{
//Delegate is executed if item doesn't exist in cache
//Any response DTO returned here will be cached automatically
});