PUT(1)
=======
:doctype: manpage


NAME
----
put - adds or updates cache entries.


DESCRIPTION
-----------
Creates entries for new keys. Replaces values for existing keys.


SYNOPSIS
--------
*put* ['OPTIONS'] `KEY` [`VALUE`]


OPTIONS
-------
*-c, --cache*='NAME'::
Specifies the name of the cache. Defaults to the currently selected cache.

*-e, --encoding*='ENCODING'::
Sets the media type for the value.

*-f, --file*='FILE'::
Specifies a file that contains the value for the entry.

*-l, --ttl*='TTL'::
Sets the number of seconds before the entry is automatically deleted
(time-to-live). Defaults to the value for `lifespan` in the cache configuration
if `0` or not specified. If you set a negative value, the entry is never
deleted.

*-i, --max-idle*='MAXIDLE'::
Sets the number of seconds that the entry can be idle. If a read or write
operation does not occur for an entry after the maximum idle time elapses, the
entry is automatically deleted. Defaults to the value for `maxIdle` in the
cache configuration if `0` or not specified. If you set a negative value, the
entry is never deleted.

*-a, --if-absent*=[true|false]::
Puts an entry only if it does not exist.


EXAMPLES
--------
`put -c mycache hello world` +
Adds the `hello` key with a value of `world` to the `mycache` cache.

`put -c mycache -f myfile -i 500 hola` +
Adds the `hola` key with the value from the contents of `myfile`. Also sets a
maximum idle of `500` seconds.


SEE ALSO
--------
get(1), remove(1)
