November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
How do you cache the content asset? If you use IObjectInstanceCache/ISynchronizedObjectInstanceCache (which is the recommended way), when you add an object to cache you can control how long before the cache will expire, using CacheEvictionPolicy
if you want to remove the cache actively, just remove the cache key
https://world.episerver.com/csclasslibraries/cms/EPiServer.Framework.Cache.IObjectInstanceCache?version=7
So, we're not caching anything ourselves.
We just inherit from "ContentProvider" and then implement all the necessary operations. Unfortunately i'm not allowed to post hyperlinks, otherwise i would've posted a snippet.
public class MyContentProvider : ContentProvider
{
protected override IContent LoadContent(ContentReference contentLink, ILanguageSelector languageSelector){}
protected override IList<GetChildrenReferenceResult> LoadChildrenReferencesAndTypes(ContentReference contentLink, string languageID, out bool languageSpecific){}
}
This is what we do. Then ofcourse we hook it up to make this turn up in the Asset pane as a new tab.
The problem is that the results of "LoadChildrenReferencesAndTypes" is cached after the first call. And we're trying to figure out where it is cached and how we can expire it.
I am looking into the implementation of ContentProvider, and can't find where the cache is implemented (Admittedly I could have missed something). Are you sure it is cached at that level, but not on higher level (IContentRepository for example)
It could be at a higher level. We're not sure about that.
Our content provider makes live API calls to an external data source. When we were debugging, we noticed that when we expand a node in the asset tree, live calls are going through, but the second time around, data turns up instantaneously, but its not making a live call. So we understand that its cached somewhere. We are trying to understand where exactly its cache (it must be SynchronizedObjectCache im guess) and how we can get the key if we need to expire it manually.
Since our last update, we also found another function that we could override
protected override void SetCacheSettings(IContent content, CacheSettings cacheSettings){}
This allows us to set the cache interval, which is good, but we still have certain conditions where we would like to "manually" expire the cache.
Just reach out to support@episerver.com. it should not cost money, at least at the beginning.
We've created a custom content asset provider repository which pulls data from an external data source. We've then used identity mapper and mapped it so that it can be used by EPiServer CMS.
Our problem is that once the content asset is cached, episerver doesn't request for the live call again since its cached.
We need to know how to expire that cache as well as what the duration of the cache is.