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 and Examine/Lucene indexes. indexes

    Constructors

    View Source

    DistributedCache(IServerMessenger, CacheRefresherCollection)

    Initializes a new instance of the DistributedCache class.

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

    The server messenger.

    CacheRefresherCollection cacheRefreshers

    The cache refreshers.

    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 cache refresher.

    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 cache refresher.

    System.Int32 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, params int[] ids)
    Parameters
    Type Name Description
    Guid refresherGuid

    The unique identifier of the cache refresher.

    System.Int32[] ids

    The unique identifier of the invalidated items.

    View Source

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

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

    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 cache refresher.

    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 cache refresher.

    View Source

    RefreshByPayload<TPayload>(Guid, TPayload[])

    Refreshes the distributed cache by payload.

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

    The unique identifier of the cache refresher.

    TPayload[] payload

    The payload.

    Type Parameters
    Name Description
    TPayload

    The type of the payload.

    View Source

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

    Refreshes the distributed cache by payload.

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

    The unique identifier of the cache refresher.

    IEnumerable<TPayload> payloads

    The payloads.

    Type Parameters
    Name Description
    TPayload

    The type of the payload.

    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 cache refresher.

    System.Int32 id

    The unique identifier of the removed item.

    View Source

    Remove(Guid, Int32[])

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

    Declaration
    public void Remove(Guid refresherGuid, params int[] ids)
    Parameters
    Type Name Description
    Guid refresherGuid

    The unique identifier of the cache refresher.

    System.Int32[] ids

    The unique identifier of the removed items.

    View Source

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

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

    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 cache refresher.

    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(Guid, Int32[])
      • Refresh<T>(Guid, Func<T, Int32>, T[])
      • RefreshAll(Guid)
      • RefreshByPayload<TPayload>(Guid, TPayload[])
      • RefreshByPayload<TPayload>(Guid, IEnumerable<TPayload>)
      • Remove(Guid, Int32)
      • Remove(Guid, Int32[])
      • Remove<T>(Guid, Func<T, Int32>, T[])
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX