WebCache.Set(String, Object, Int32, Boolean) WebCache.Set(String, Object, Int32, Boolean) WebCache.Set(String, Object, Int32, Boolean) Method

Definition

Inserts an item into the WebCache object.

public static void Set (string key, object value, int minutesToCache = 20, bool slidingExpiration = true);
static member Set : string * obj * int * bool -> unit
Public Shared Sub Set (key As String, value As Object, Optional minutesToCache As Integer = 20, Optional slidingExpiration As Boolean = true)
Parameters
key
String String String

The identifier for the cache item.

value
Object Object Object

The data to insert into the cache.

minutesToCache
Int32 Int32 Int32

Optional. The number of minutes to keep an item in the cache. The default is 20.

slidingExpiration
Boolean Boolean Boolean

Optional. true to indicate that the cache item expiration is reset each time the item is accessed, or false to indicate that the expiration is based the absolute time since the item was added to the cache. The default is true. In that case, if you also use the default value for the minutesToCache parameter, a cached item expires 20 minutes after it was last accessed.

Exceptions

Sliding expiration is enabled and the value of minutesToCache is greater than a year.

Applies to