Skip to content

Commit ca70f7e

Browse files
authored
document pruning and the prune method in readme
1 parent f47551c commit ca70f7e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ To invalidate tags, call the method `Psr6Store::invalidateTags` or use the
103103
`PurgeTagsListener` from the [FOSHttpCache][3] library to handle tag
104104
invalidation requests.
105105

106+
### Pruning Expired Cache Entries
107+
108+
By default, this cache removes expired entries from the cache after every 500
109+
cache write operations. You can change the frequency with the `prune_threshold`
110+
configuration setting.
111+
112+
You can also manually trigger pruning by calling the `prune()` method on the
113+
cache. With this, you could for example implement a cronjob that loads the store
114+
and prunes it at a configured interval, to prevent slowing down random requests
115+
that were cache misses because they have to wait for the pruning to happen. If you
116+
have set up a cron job, you should disable pruning by setting the threshold to 0.
117+
106118
### WARNING
107119

108120
It is possible to configure other cache adapters or lock stores than the

0 commit comments

Comments
 (0)