composer require contributte/cacheDon't waste time by passing Nette\Caching\IStorage directly to your classes. Use our tuned CacheFactory.
extensions:
cache.factory: Contributte\Cache\DI\CacheFactoryExtensionBy default Nette\Caching\Cache is provided when $cacheFactory->create() is called. You can change it to your implementation.
services:
cache.factory.factory: App\Model\MyCacheFactory-
MemoryAdapterStorage
- Optimized for reading of same key multiple times during one application run
use Contributte\Cache\Storages\MemoryAdapterStorage;
use Nette\Caching\Storages\FileStorage;
use Nette\Caching\Storages\SQLiteJournal;
$storage = new MemoryAdapterStorage(
new FileStorage($path, new SQLiteJournal($path))
);Show all calls to storage in Tracy panel
extensions:
cache.debug: Contributte\Cache\DI\DebugStorageExtension
cache.debug:
debug: %debugMode%