Add cache touch support#68
Conversation
Greptile SummaryThis PR adds a
Confidence Score: 4/5Safe to merge for single-writer workloads; concurrent save+touch on the same key in Redis, RedisCluster, Memcached, or Hazelcast can silently revert a just-saved payload to stale data. The non-atomic read-modify-write in the network-backed adapters (Redis, RedisCluster, Memcached, Hazelcast) introduces a window where a concurrent src/Cache/Adapter/Redis.php, src/Cache/Adapter/RedisCluster.php, src/Cache/Adapter/Memcached.php, src/Cache/Adapter/Hazelcast.php — all four implement touch() with a non-atomic read-modify-write. Important Files Changed
Reviews (3): Last reviewed commit: "fix: stabilize filesystem touch test" | Re-trigger Greptile |
Summary
touch()cache API for refreshing an existing entry timestamp without changing its data.touch()across all adapters, delegating through existing load/save paths where appropriate.Testing
composer formatcomposer checkcomposer lint./vendor/bin/phpunit tests/Cache/MemoryTest.php tests/Cache/NoneTest.php tests/Cache/FilesystemTest.php --filter 'testCacheTouch|testCacheSave|testCachePurge'Notes