Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expiration duration. Optional.

Remarks

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

Specifying value as null removes object from cache.

Example

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

Remarks

If duration is not specified, object is stored as indefinitely until cache is cleared.

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

Specifying value as null removes object from cache.

Example

How to store an object in cache

Code Block
languagejs
var id = 1;
$Cache.Set("myObject:" + id, {

 Name : 'Madonna'
}, "12:00:00");

...

Example

How to store an object in cache with duration

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

See Also