Latest release: v0.3

Cache / Caching

Content

Cache Factory

This simple extesions is very useful. Don't waste time by passing Nette\Caching\IStorage directly to your classes. Use our tuned CacheFactory.

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

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
1
2

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))
               );
    
    1
    2
    3
    4
    5
    6
    7