Skip to content

Commit a247281

Browse files
authored
Update README.md
1 parent 0041dbb commit a247281

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ Cache::push('person', 36, 'age'); // Now person is ['name' => 'John', 'age' => 3
5353
// Or push elements without named indexes
5454
Cache::push('people', 'John'); // people = ['John']
5555
Cache::push('people', 'Jonas'); // Now people is ['John', 'Jonas']
56+
// NOTE: Each pushing will reset the ttl of the whole array; not only the new element's.
57+
// You can set a new ttl for the whole array when pushing like:
58+
Cache::push('person', 'Barber', 'occupation', 300); // Now the ttl of the "person" array is reset to 5 minutes.
5659

5760
// Get a cached value
5861
// Non-existent or expired keys will return null

0 commit comments

Comments
 (0)