Skip to content

Latest commit

 

History

History
120 lines (63 loc) · 3.12 KB

caching.rst

File metadata and controls

120 lines (63 loc) · 3.12 KB

Caching

The Caching API makes it easy to work with object caching, either locally on one server or distributed to all servers in an Omnia server cluster (similar to Distributed Cache used in SharePoint).

You reach the Caching API through the following service

The API contains the following methods:

AddOrUpdateMemoryCache #######

Adds or updates an already existing object in the memory cache

Optionally you can supply an expiration time as a DateTimeOffset

GetFromMemoryCache #######

Gets an object from the memory cached by suppling the key the object was stored with

GetFromMemoryCache<T> #######

Gets an object from the memory cached by suppling the key the object was stored with. Casts the object to the supplied type

MemoryCacheContains #######

Checks if an object with the given key is present in the memory cache

RemoveFromMemoryCache #######

Deletes the object with the given key from the memory cache

AddOrUpdateDistributedCache #######

Adds or updates an already existing object in the distributed cache

Optionally you can cache the data encrypted

You can also cache multiple objects at once by creating a List<CachedItem> (CachedItem is found in the Omnia.Foundation.Extensibility.Core.Caching namespace

GetFromDistributedCache #######

Gets objects from the distributed cache by supplying a list of the keys the items are stored with

GetFromDistributedCache<T> #######

Gets an object from the distributed cache, cast to the specified type

RemoveFromDistributedCache #######

Deletes objects from the distributed cache by supplying a list of keys