Show Table of Contents
Chapter 1. $fh.cache
$fh.cache(options, callback);
Cache an object in the cloud for a period of time.
1.1. Examples
Save a value to the cache
var options = {
"act": "save",
"key": "foo", // The key associated with the object
"value": "bar", // The value to be cached, must be serializable
"expire": 60 // Expiry time in seconds. Optional
};
$fh.cache(options, function (err, res) {
if (err) return console.error(err.toString());
// res is the original cached object
console.log(res.toString());
});
Load a value from the cache
var options = {
"act": "load",
"key": "foo" // key to look for in cache
};
$fh.cache(options, function (err, res) {
if (err) return console.error(err.toString());
// res is the original cached object
console.log(res.toString());
});
Remove a value from the cache
var options = {
"act": "remove",
"key": "foo" // key to look for in cache
};
$fh.cache(options, function (err, res) {
if (err) return console.error(err.toString());
// res is the removed cached object
console.log(res.toString());
});

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.