Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Contributte Cache

Content

Setup

composer require contributte/cache

Cache Factory

Don't waste time by passing Nette\Caching\IStorage directly to your classes. Use our tuned CacheFactory.

extensions:
	cache.factory: Contributte\Cache\DI\CacheFactoryExtension

By 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

Storages

  • 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))
);

Debug panel

Show all calls to storage in Tracy panel

extensions:
	cache.debug: Contributte\Cache\DI\DebugStorageExtension

cache.debug:
	debug: %debugMode%

Debug panel screenshot