Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10.x][Cache] Fix handling of
false
values in apc (#49145)
* [10.x][Cache] Fix handling of `false` values in apc This commit addresses an issue in the `ApcWrapper` and `ApcStore` components of the caching system, particularly when dealing with a cached value of `false`. Previously, the `ApcWrapper`'s default behavior was to simply retrieve and return values from the APC cache store. However, in `ApcStore::get()`, there was a check to determine if the returned value was not `false`. If it wasn't, the value would be returned. This posed a problem where a `false` value is legitimately stored in the cache, but the existing check led to unnecessary cache misses and repeated `get` & `store` operations. To resolve this, we have modified the implementation. Now, we leverage the second parameter of `apc_fetch`, which indicates whether the fetch operation was successful. This allows `ApcStore` to accurately differentiate between a successful fetch of a `false` value and a failed fetch operation. * Add missing test
- Loading branch information