Skip to content

Commit ff04898

Browse files
update usage
1 parent 1478d5e commit ff04898

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

USAGE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@ It returns a boolean type `TRUE` on success and `FALSE` on failure.
229229

230230
If the `$ttl` parameter is not specified, the class default TTL will be used.
231231

232+
#### Special TTL Note
233+
234+
If you specify a TTL of `0` in the `set` function, thy `key => value` pair will
235+
be cached as long as possible.
236+
237+
If you specify a TTL of `-1` in the `set` function and you have previously set
238+
the default TTL to at least 6000 seconds (100 minutes), then a random number of
239+
seconds between 0 and 15% of the default TTL will randomly be added or
240+
substracted to the default TTL and used. This is to allow staggering the cache
241+
expiration when you cache a lot of items at once, such as with cache warming.
242+
232243

233244
### `$CacheObj->delete($key);`
234245

@@ -285,6 +296,18 @@ TTL to use depending on the individual pair.
285296

286297
This method returns a Boolean type `TRUE` on success and `FALSE` on failure.
287298

299+
#### Special TTL Note
300+
301+
If you specify a TTL of `0` in the `setMultiple` function, thy `key => value`
302+
pair will be cached as long as possible.
303+
304+
If you specify a TTL of `-1` in the `setMultiple` function and you have
305+
previously set the default TTL to at least 6000 seconds (100 minutes), then a
306+
random number of seconds between 0 and 15% of the default TTL will randomly be
307+
added or substracted to the default TTL and used. This is to allow staggering
308+
the cache expiration when you cache a lot of items at once, such as with cache
309+
warming.
310+
288311

289312
### `$CacheObj->deleteMultiple($keys);`
290313

0 commit comments

Comments
 (0)