Skip to main content

HttpRuntimeCacheStorage

Understands how to store a ServiceStack.MiniProfiler.MiniProfiler to the System.Web.HttpRuntime.Cache with absolute expiration.

Assembly: ServiceStack.NetFramework.dll
View Source
Declaration
public class HttpRuntimeCacheStorage : IStorage

Properties

CacheDuration

How long to cache each ServiceStack.MiniProfiler.MiniProfiler for (i.e. the absolute expiration parameter of System.Web.Caching.Cache.Insert(System.String%2cSystem.Object%2cSystem.Web.Caching.CacheDependency%2cSystem.DateTime%2cSystem.TimeSpan%2cSystem.Web.Caching.CacheItemUpdateCallback))

View Source
Declaration
public TimeSpan CacheDuration { get; set; }

Fields

CacheKeyPrefix

The string that prefixes all keys that MiniProfilers are saved under, e.g. "mini-profiler-ecfb0050-7ce8-4bf1-bf82-2cb38e90e31e".

View Source
Declaration
public const string CacheKeyPrefix = "mini-profiler-"

Methods

Save(MiniProfiler)

Saves <code data-dev-comment-type="paramref" class="paramref">profiler</code> to the HttpRuntime.Cache under a key concated with ServiceStack.MiniProfiler.Storage.HttpRuntimeCacheStorage.CacheKeyPrefix and the parameter's ServiceStack.MiniProfiler.MiniProfiler.Id.

View Source
Declaration
public void Save(MiniProfiler profiler)
Parameters
TypeName
ServiceStack.MiniProfiler.MiniProfilerprofiler

Load(Guid)

Returns the saved ServiceStack.MiniProfiler.MiniProfiler identified by <code data-dev-comment-type="paramref" class="paramref">id</code>. Also marks the resulting profiler ServiceStack.MiniProfiler.MiniProfiler.HasUserViewed to true.

View Source
Declaration
public MiniProfiler Load(Guid id)
Returns

ServiceStack.MiniProfiler.MiniProfiler

Parameters
TypeName
System.Guidid

GetUnviewedIds(String)

Returns a list of ServiceStack.MiniProfiler.MiniProfiler.Ids that haven't been seen by <code data-dev-comment-type="paramref" class="paramref">user</code>.

View Source
Declaration
public List<Guid> GetUnviewedIds(string user)
Returns

System.Collections.Generic.List<System.Guid>

Parameters
TypeNameDescription
System.StringuserUser identified by the current MiniProfiler.Settings.UserProvider.

|

Implements