Dealing with 'mixed tps' entries in a cache? #805
-
We have a cache that has both high and low 'tps' entries. For the high tps entries, we wish to minimize latency. We use the setting where we return the 'stale' value from the cache and update the cache with the new value after it's retrieved (I believe this is 'refreshAfterWrite'?). This works great because most of our entries are requested often enough that the current value in cache really isn't that old. However, we also have 'low tps' entries that only get requested infrequently. For these, we value getting the correct value over getting a stale answer quickly. A synchronous load of the value would be fine. I've been trying to think of a proper way to implement this. Perhaps I could have an Expiry that keys off a 'isLowTps' field on the entry? Maybe we have to have a completely separate cache for the low tps entries with a different config, or maybe we simply exclude these from the cache entirely? I realize this is very much in the realm of an implementation question, but if you have any suggestions or pointers for reading I'd really appreciate it. Thank you for your time. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
yeah, it's not clear if this is a feature request or an implementation design question. It sounds like you could use different expiration times for the entry type. The size policy would then also prefer evicting low tps entries as not popular, so between those two it should often be reloaded. |
Beta Was this translation helpful? Give feedback.
yeah, it's not clear if this is a feature request or an implementation design question. It sounds like you could use different expiration times for the entry type. The size policy would then also prefer evicting low tps entries as not popular, so between those two it should often be reloaded.