I'm working on enabling sublayout caching for personalized sublayouts.
public class ContextCacheableSublayout : Sublayout
{
public override string GetCacheKey()
{
var cacheKey = base.GetCacheKey();
cacheKey = string.Concat(cacheKey, GetCustomCacheKeyPart());
return cacheKey;
}
private string GetCustomCacheKeyPart()
{
//// GET DATASOURCE WITH PERSONALIZATION
}
}
Basically I just need to generate a cache key based on the correct datasource given the personalization rules. I have the Sublayout already, which has this.Datasource
. But how do I make sure to get the current personalized datasource?
I'm following this post as a reference but it pertains to MVC, and I'm not sure how to do the same things with webforms
this.Datasource
get swapped out if personalization occurs? Is it part of theSublayout
code? I'm struggling to remember how WebForms work lol!