Keep README in sync with changes from PR #200 (#403)

This commit is contained in:
Brent Watson 2022-03-30 08:19:00 -06:00 committed by GitHub
parent e612226d76
commit 9721acd244
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -225,14 +225,14 @@ StoreBuilder
deleteAll = db.postDao()::clearAllFeeds
)
).cachePolicy(
MemoryPolicy.builder()
.setMemorySize(10)
MemoryPolicy.builder<Any, Any>()
.setMaxSize(10)
.setExpireAfterAccess(10.minutes) // or setExpireAfterWrite(10.minutes)
.build()
).build()
```
* `setMemorySize(maxSize: Long)` sets the maximum number of entries to be kept in the cache before starting to evict the least recently used items.
* `setMaxSize(maxSize: Long)` sets the maximum number of entries to be kept in the cache before starting to evict the least recently used items.
* `setExpireAfterAccess(expireAfterAccess: Duration)` sets the maximum time an entry can live in the cache since the last access, where "access" means reading the cache, adding a new cache entry, and replacing an existing entry with a new one. This duration is also known as **time-to-idle (TTI)**.
* `setExpireAfterWrite(expireAfterWrite: Duration)` sets the maximum time an entry can live in the cache since the last write, where "write" means adding a new cache entry and replacing an existing entry with a new one. This duration is also known as **time-to-live (TTL)**.