Skip to content

messageCache.setValue

Signature: messageCache.setValue(key, value)

Returns: String previousValue - the previous value associated with the key

Set the value associated with the key.

Parameters

Type Name Description Default
String key a unique string used to identify the cached value
String value the new value to associate with the 'key'

Example

// Set a value in the message cache
messageCache.setValue("key", "value");

// Retrieve the cached value
var cachedValue = messageCache.getValue("key"); // value