Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (32 sloc) 1.02 KB

Contributte Cache

Content

Setup

composer require contributte/cache

Cache Factory

This simple extension 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

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))
               );
You can’t perform that action at this time.