Search Results for

    Show / Hide Table of Contents
    View Source

    Class DistributedCache

    Represents the entry point into Umbraco's distributed cache infrastructure.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Cache
    Assembly: Umbraco.Core.dll
    Syntax
    public sealed class DistributedCache
    Remarks

    The distributed cache infrastructure ensures that distributed caches are invalidated properly in load balancing environments.

    Distribute caches include static (in-memory) cache, runtime cache, front-end content cache, Examine/Lucene indexes

    Constructors

    View Source

    DistributedCache(IServerMessenger, CacheRefresherCollection)

    Declaration
    public DistributedCache(IServerMessenger serverMessenger, CacheRefresherCollection cacheRefreshers)
    Parameters
    Type Name Description
    IServerMessenger serverMessenger
    CacheRefresherCollection cacheRefreshers

    Methods

    View Source

    Refresh(Guid, Guid)

    Notifies the distributed cache of a specified item invalidation, for a specified ICacheRefresher.

    Declaration
    public void Refresh(Guid refresherGuid, Guid id)
    Parameters
    Type Name Description
    Guid refresherGuid

    The unique identifier of the ICacheRefresher.

    Guid id

    The unique identifier of the invalidated item.

    View Source

    Refresh(Guid, Int32)

    Notifies the distributed cache of a specified item invalidation, for a specified ICacheRefresher.

    Declaration
    public void Refresh(Guid refresherGuid, int id)
    Parameters
    Type Name Description
    Guid refresherGuid

    The unique identifier of the ICacheRefresher.

    System.Int32 id

    The unique identifier of the invalidated item.

    View Source

    Refresh<T>(Guid, Func<T, Int32>, T[])

    Notifies the distributed cache of specified item invalidation, for a specified ICacheRefresher.

    Declaration
    public void Refresh<T>(Guid refresherGuid, Func<T, int> getNumericId, params T[] instances)
    Parameters
    Type Name Description
    Guid refresherGuid

    The unique identifier of the ICacheRefresher.

    Func<T, System.Int32> getNumericId

    A function returning the unique identifier of items.

    T[] instances

    The invalidated items.

    Type Parameters
    Name Description
    T

    The type of the invalidated items.

    Remarks

    This method is much better for performance because it does not need to re-lookup object instances.

    View Source

    RefreshAll(Guid)

    Notifies the distributed cache of a global invalidation for a specified ICacheRefresher.

    Declaration
    public void RefreshAll(Guid refresherGuid)
    Parameters
    Type Name Description
    Guid refresherGuid

    The unique identifier of the ICacheRefresher.

    View Source

    RefreshByPayload<TPayload>(Guid, TPayload[])

    Declaration
    public void RefreshByPayload<TPayload>(Guid refresherGuid, TPayload[] payload)
    Parameters
    Type Name Description
    Guid refresherGuid
    TPayload[] payload
    Type Parameters
    Name Description
    TPayload
    View Source

    RefreshByPayload<TPayload>(Guid, IEnumerable<TPayload>)

    Declaration
    public void RefreshByPayload<TPayload>(Guid refresherGuid, IEnumerable<TPayload> payloads)
        where TPayload : class
    Parameters
    Type Name Description
    Guid refresherGuid
    IEnumerable<TPayload> payloads
    Type Parameters
    Name Description
    TPayload
    View Source

    Remove(Guid, Int32)

    Notifies the distributed cache of a specified item removal, for a specified ICacheRefresher.

    Declaration
    public void Remove(Guid refresherGuid, int id)
    Parameters
    Type Name Description
    Guid refresherGuid

    The unique identifier of the ICacheRefresher.

    System.Int32 id

    The unique identifier of the removed item.

    View Source

    Remove<T>(Guid, Func<T, Int32>, T[])

    Notifies the distributed cache of specified item removal, for a specified ICacheRefresher.

    Declaration
    public void Remove<T>(Guid refresherGuid, Func<T, int> getNumericId, params T[] instances)
    Parameters
    Type Name Description
    Guid refresherGuid

    The unique identifier of the ICacheRefresher.

    Func<T, System.Int32> getNumericId

    A function returning the unique identifier of items.

    T[] instances

    The removed items.

    Type Parameters
    Name Description
    T

    The type of the removed items.

    Remarks

    This method is much better for performance because it does not need to re-lookup object instances.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • DistributedCache(IServerMessenger, CacheRefresherCollection)
    • Methods
      • Refresh(Guid, Guid)
      • Refresh(Guid, Int32)
      • Refresh<T>(Guid, Func<T, Int32>, T[])
      • RefreshAll(Guid)
      • RefreshByPayload<TPayload>(Guid, TPayload[])
      • RefreshByPayload<TPayload>(Guid, IEnumerable<TPayload>)
      • Remove(Guid, Int32)
      • Remove<T>(Guid, Func<T, Int32>, T[])
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX