amphp/cache
Non-blocking cache library for Amp-based PHP apps. Provides async cache interfaces and adapters (e.g., in-memory, filesystem, Redis) with TTL support, atomic operations, and PSR-style ergonomics for high-concurrency services.
AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.
amphp/cache specifically provides a cache interface and multiple implementations of it.
This package can be installed as a Composer dependency.
composer require amphp/cache
<?php
namespace Amp\Cache;
interface Cache
{
public function get(string $key): mixed;
public function set(string $key, mixed $value, int $ttl = null): void;
public function delete(string $key): ?bool;
}
Cache implementation that just ignores all operations and always resolves to null.
How can I help you explore Laravel packages today?