Class CacheAllStreams
Special DataSource which automatically caches everything it's given.
It's Used to optimize queries, so that heavier calculations don't need to be repeated if another request with the same signature is used.
Internally it asks all up-stream DataSources what factors would determine their caching.
So if part of the supplying DataSources would have a changed parameter (like a different filter), it will still run the full query and cache the results again.
Inheritance
Implements
Inherited Members
Namespace: ToSic.Eav.DataSources.Caching
Assembly: ToSic.Eav.DataSources.dll
Syntax
[VisualQuery(NiceName = "Cache Streams", UiHint = "Cache all streams based on some rules", Icon = "history_toggle_off", Type = DataSourceType.Cache, NameId = "ToSic.Eav.DataSources.Caching.CacheAllStreams, ToSic.Eav.DataSources", DynamicOut = true, DynamicIn = true, ConfigurationType = "|Config ToSic.Eav.DataSources.Caches.CacheAllStreams", NameIds = new string[]{"ToSic.Eav.DataSources.Caches.CacheAllStreams, ToSic.Eav.DataSources"}, HelpLink = "https://github.com/2sic/2sxc/wiki/DotNet-DataSource-CacheAllStreams")]
[PublicApi_Stable_ForUseInYourCode]
public class CacheAllStreams : DataSourceBase, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheInfo, ICacheKey, ICacheExpiring, ITimestamped, ICanPurgeListCache, IHasLog, IDataTarget, IAppIdentitySync, IDataSourceLinkable
Remarks
- Changed in v15.05 to use the immutable convention
- note that the above change is actually a breaking change, but since this is such an advanced DataSource, we assume it's not used in dynamic code.
Properties
| Improve this Doc View SourceCacheDurationInSeconds
How long to keep these streams in the cache.
Default is 0
- meaning fall back to 1 day
Declaration
[Configuration(Fallback = 0)]
public int CacheDurationInSeconds { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Out
Gets the Dictionary of Out-Streams. This is the internal accessor, as usually you'll use this["name"] instead.
In rare cases you need the Out, for example to list the stream names in the data source.
Declaration
public override IReadOnlyDictionary<string, IDataStream> Out { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyDictionary<System.String, IDataStream> | A dictionary of named IDataStream objects, case insensitive |
Overrides
| Improve this Doc View SourceRefreshOnSourceRefresh
If a source-refresh should trigger a cache rebuild
Declaration
[Configuration(Fallback = true)]
public bool RefreshOnSourceRefresh { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ReturnCacheWhileRefreshing
Perform a cache rebuild async.
Declaration
[Configuration(Fallback = false)]
public bool ReturnCacheWhileRefreshing { get; }
Property Value
Type | Description |
---|---|
System.Boolean |