Hi Deepa,
I had a look through the blog post and I just wanted to check you have done the following:
If this is all working then I think a good place to start looking is the order of the service registration.
From the first blog you should have added:
services.AddOutputCaching();
To then use the custom implementation of 'IOutputCacheVaryByCustomService' you would need to call the service registration after this:
services.AddTransient<IOutputCacheVaryByCustomService, OuputCacheVaryByCustomService>();
Does this all look like your code?
You can see the example startup.cs here
Paul
I believe no content cache will work unless you set the content cache properties in appsettings, see https://docs.developers.optimizely.com/content-management-system/docs/configuring-cms#contentoptions
E.g.
"EPiServer": {
"CMS": {
"Content": {
"VersionCacheSlidingExpiration": "0:0:10",
"ContentCacheSlidingExpiration": "0:0:10"
}
}
}
Hello,
Yes added this configuration in appsettings.json file. It will not fire the GetVaryByCustomString() method from service.
Do we need to call this method explicitly apart from adding this line [] for controller action method?
Thanks,
Deepa
Hello,
We are referring solution given in this link for implementing VaryByCustom caching. But it is not going through this method.
Can anyone suggest on what might be missing for this to work or help on how can this implemented in CMS 12 to work.
Thanks,
Deepa