| sidebar_position |
|---|
9 |
This class uses tmpfs as the cache engine.
The TmpfsCacheEngine stores cache files in the /dev/shm tmpfs (temporary file system in RAM).
:::info
This engine extends FileSystemCacheEngine and automatically uses /dev/shm as the storage path for better performance.
:::
$cache = new \ByJG\Cache\Psr16\TmpfsCacheEngine($prefix, $logger);Parameters:
$prefix(string, default: 'cache'): Prefix to avoid cache key collisions$logger(LoggerInterface|null, default: null): PSR-3 logger instance
$cachePool = \ByJG\Cache\Factory::createTmpfsCachePool($prefix, $logger);or
$cachePool = new \ByJG\Cache\Psr6\CachePool(new \ByJG\Cache\Psr16\TmpfsCacheEngine($prefix, $logger));