Another quick couchbase question. Would I be correct in assuming that using lookup() to determine whether to pull fresh data and do a set() would not be a good idea to use with the couchbase provider/server? I’ve not found it to be particularly reliable anyway but I would guess that with couchbase it would be even less so. I’m planning to just implement the getOrSet which wasn’t included in the couchbase provider which uses the far more reliable method of attempting a get() and if nothing is returned, doing the set. That’s typically what I do in code anyway so I liked having that method available to shortcut it.
It might be worth mentioning that and/or changing it on the cachebox wiki, as it’s used as the sample method for checking cache items and setting them. I had to go back and get rid of those even with the normal cachebox provider due to that being a problem.
FYI, just added a pull request for the getAndSet on the couchbase provider code.
Like Luis mentioned, it is possible that an item could be removed from cache between when you checked for its existence and when you actually retrieved it in a second operation.
That said, can you expound on the unreliability you were seeing?
Exactly that behavior. Running lookup() to see if a cache item exists and getting true but then it not being there later in the request when running the get().