contributte / doctrine-orm

:fire: Well-integrated Doctrine ORM for Nette Framework

Home Page:https://contributte.org/packages/nettrine/orm.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimal configuration for using Redis as cache

DepkaCZ opened this issue · comments

Hi,

as discussed on slack here's the minimal guide to use redis as a doctrine/nettrine cache:

First install contributte/redis package:
composer require contributte/redis

Then register it in neon:

extensions:
	redis: Contributte\Redis\DI\RedisExtension

redis:
	# Setup Tracy panel
	debug: %debugMode%

	connection:
		default:
			uri: tcp://127.0.0.1:6379

			# Options passed directly to Predis\Client
			# https://github.com/nrk/predis#client-configuration
			options: []

and lastly use it as a cache for doctrine:

nettrine.cache:
  driver: Doctrine\Common\Cache\PredisCache