How to use [cache.set]

The reference page of cache.set has its arguments, constraints and declaration.

Invoke this slot to save an item to the cache. The slot takes 3 properties, which are as follows.

  • Value of node, being the key for your cache item.
  • [value] - The item to actually save to the cache. If you pass in null, any existing cache items matching your key will be removed
  • [expiration] - Number of seconds to keep the item in the cache. Defaults to 5

Below is an example of a piece of Hyperlambda that simply saves the value of “Howdy world” to your cache, using “cache-item-key” as the key for the cache item.

cache.set:cache-item-key
   expiration:5
   value:Howdy world

To remove the above item, you can use the following Hyperlambda.

cache.set:cache-item-key