-
Notifications
You must be signed in to change notification settings - Fork 16
Description
When using CAS to fill a cache entry, we want to read from the local cache to try to get a cache hit without going to the remote cache. With #66 the local cache is updated at the end of the CAS methods, but it isn't used for reading, which does make sense in other cases where we want to make sure the remote cache entry is updated to the correct value. We also can't seamlessly add local cache reading to the CAS methods, since the given block is also used to compute the updated value which can be expensive when involving database loads where we only want to do that after first reading from the remote cache.
Currently, Active Support doesn't support getting the local cache to read from directly. I also can't think of a good reason to use that with the methods Active Support supports, since it doesn't support CAS operations.
Adding support for local cache reads would avoid this problem and given the application flexibility in how it handles the local cache value. Currently, I don't see a need to expose local cache writes so I think we could avoid exposing the local cache object or encouraging the application to manage the updating of the local cache directly.