cache/apcu-adapter
PSR-6 cache pool adapter backed by APCu from the PHP Cache organization. Drop-in cache implementation with no configuration required—instantiate ApcuCachePool and start caching. Supports shared PHP-Cache features like tagging and hierarchy via docs.
FileCache, RedisCache). This ensures compatibility with Laravel’s caching abstractions (e.g., Cache::store()).Cache::tags()).php-cache/cache).Cache facade and CacheManager.Cache::tags()->put() syntax.php.ini).config/cache.php as:
'apcu' => [
'driver' => 'cache',
'store' => 'apcu',
],
Cache::tags(['users'])->put()).Cache::store('apcu')->clear()).apc.enable_cli=1 for CLI apps (e.g., queues, Artisan).apc.shm_size (default: 32MB). May require tuning for large-scale apps.apc.lockwait cautiously.apc.enable_cli, apc.shm_size) across all environments (dev/staging/prod)?apc.shm_segments, apc.shm_ram) be monitored?Cache facade, CacheManager, and PSR-6 abstractions.apcu (enabled in php.ini).php-redis (if using a fallback cache driver).Cache::get(), Cache::tags()).config/cache.php:
'apcu' => [
'driver' => 'cache',
'store' => 'apcu',
'ttl' => 60 * 60, // Default TTL (optional)
],
.env:
CACHE_DEFAULT=apcu
ApcuCachePool behaves as expected with Laravel’s Cache facade.Cache::forget(), Cache::tags()->flush()).CacheManager:
'stores' => [
'apcu' => [
'driver' => 'cache',
'store' => 'apcu',
'failover' => 'redis', // Fallback to Redis if APCu fails
],
],
CacheItemPool interface.php.ini and restart PHP-FPM.Cache::put('test', 'value', 60)).Cache::tags(), Cache::remember(), etc.apc.shm_ram) and hit rates.apc.shm_size and TTLs based on usage patterns.apc.shm_size, apc.enable_cli) must be consistent across environments.php.ini settings.ApcuCachePool to emit events).$pool = new ApcuCachePool();
$pool->addListener(new CacheListener()); // Custom listener for metrics
apc.enable_cli=0 in CLI).apc.shm_size too low).apc.php (if installed) for runtime stats.php -m | grep apcu to verify extension load.apc.shm_size (e.g., 128M for memory-intensive apps).apc.shm_ram to avoid fragmentation.Cache::tags()->flush()) may be slower than Redis.How can I help you explore Laravel packages today?