Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

Stores an object in cache.

void $Cache.Set(key: string, value: object)

Stores an object in cache with duration limit

void $Cache.Set(key: string, value: object, duration: string)

Arguments

string key
Key of value
object value
value to be stored
string duration
Expiration duration. Optional.

Remarks

Duration can be specified in "day.hh:mm:ss" format.

Specifying value as null removes object from cache.

Example

var id = 1;
$Cache.Set("myObject:" + id, {
 Name : 'Madonna'
}, "12:00:00");

Remarks

Duration can be specified in "day.hh:mm:ss" format.

Specifying value as null removes object from cache.

Example

var id = 1;
$Cache.Set("myObject:" + id, {
  Name : 'Madonna'
}, "12:00:00");

Examples

var id = 1;
$Cache.Set("myObject:" + id, {
 Name : 'Madonna'
}, "12:00:00");
var id = 1;
$Cache.Set("myObject:" + id, {
  Name : 'Madonna'
}, "12:00:00");
  • No labels