Vampire
04/16/2025, 9:33 AMrefreshAfterWrite
instead of expireAfterWrite
for the cache?
• (maybe combined with a size based eviction using maximumSize
that evicts LRU if max size is reached, softValues
is not usable as Aedile uses an AsyncCache
under the hood.)
• Would it maybe make sense to also cache the maven-metadata.xml
generation now that using version ranges is a thing and not only Renovate and friends use it?Piotr Krzemiński
04/16/2025, 9:40 AMrefreshAfterWrite
- I was looking for something like this, great idea! success baby so in practice it means that we'll avoid cache miss if the expiration time is hit, and the older entry will be served until the newer one is computed in the background, right? if yes, I'm all for using it. Too bad the readme of https://github.com/sksamuel/aedile doesn't mention it, but in https://github.com/ben-manes/caffeine 's readme it's indeed there
• maximumSize
- the goal is to save us from running out of memory, right? in practice, I don't think we've ever hit this issue, but feel free to set a value like 1000 perhaps? I've never done any measurements of how much memory a single average binding takes, so it's hard to say for sure
• caching maven-metadata.xml
- yes, makes sense to me as wellVampire
04/16/2025, 10:41 PMso in practice it means that we'll avoid cache miss if the expiration time is hit, and the older entry will be served until the newer one is computed in the background, right?That's how I got it, yes.
the goal is to save us from running out of memory, right?Most probably, yes. I guess we can also start without. But it might make sense to add a metric about cache size, amount of bindings should probably sufficient, what do you think @LeoColman? Then - especially when using
refresh...
instead of expire...
we can see how the cache grows and how it relates to the memory to find a good balanced combination of max size and max heap if necessary.LeoColman
04/16/2025, 10:42 PMLeoColman
04/17/2025, 1:47 AM