• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API
v16
Search Results for

    Show / Hide Table of Contents

    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
    object
    ServiceBase
    ServiceBase<DataSourceBase.MyServices>
    DataSourceBase
    CacheAllStreams
    Implements
    IDataSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceLinkable
    Inherited Members
    DataSourceBase.Immutable
    DataSourceBase.AppId
    DataSourceBase.ZoneId
    DataSourceBase.Guid
    DataSourceBase.Error
    DataSourceBase.CacheTimestamp
    DataSourceBase.CacheChanged(long)
    DataSourceBase.Configuration
    DataSourceBase.Link
    DataSourceBase.In
    DataSourceBase.TryGetIn(string)
    DataSourceBase.TryGetOut(string)
    DataSourceBase.this[string]
    DataSourceBase.GetStream(string, string, bool, bool)
    DataSourceBase.List
    DataSourceBase.Attach(IDataSource)
    DataSourceBase.Attach(string, IDataSource, string)
    DataSourceBase.Attach(string, IDataStream)
    DataSourceBase.ProvideOut(Func<IEnumerable<IEntity>>, string)
    DataSourceBase.ProvideOut(Func<IImmutableList<IEntity>>, string)
    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, ICacheKey, ICacheExpiring, ITimestamped, IHasLog, 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 Source

    CacheDurationInSeconds

    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
    int
    | Improve this Doc View Source

    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
    IReadOnlyDictionary<string, IDataStream>

    A dictionary of named IDataStream objects, case insensitive

    Overrides
    DataSourceBase.Out
    | Improve this Doc View Source

    RefreshOnSourceRefresh

    If a source-refresh should trigger a cache rebuild

    Declaration
    [Configuration(Fallback = true)]
    public bool RefreshOnSourceRefresh { get; }
    Property Value
    Type Description
    bool
    | Improve this Doc View Source

    ReturnCacheWhileRefreshing

    Perform a cache rebuild async.

    Declaration
    [Configuration(Fallback = false)]
    public bool ReturnCacheWhileRefreshing { get; }
    Property Value
    Type Description
    bool

    Implements

    IDataSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceLinkable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX