Skip to content

$Cache.Set

Overview

void $Cache.Set ( key, value, [duration] )

Stores a object in cache.

Arguments

String key Key of value

Object value Value to be stored.

String__ Duration__ Expiration duration. Optional.

Remarks

  • If duration is not specified, object is stored as indefinitely until cache is cleared.
  • Duration can be specified in "day.hh🇲🇲ss" format.
  • Specifying value as null removes object from cache.

Examples

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

See Also