kimjo
kimjo

Reputation: 39

How to disable Cache in Symfony 5.2?

How can I completely disable the cache in Symfony 5.2?

I use PHP config file (services.php) and not the yaml ones. In the docs, I cannot find anything matching.

Upvotes: 2

Views: 5389

Answers (1)

Arleigh Hix
Arleigh Hix

Reputation: 10867

Try configuring the two pools that are always enabled by default to use the Symfony\Component\Cache\Adapter\NullAdapter

framework:
    cache:
        app: cache.adapter.null
        system: cache.adapter.null

services:
    cache.adapter.null:
        class: Symfony\Component\Cache\Adapter\NullAdapter
        arguments: [~] # small trick to avoid arguments errors on compile-time.

https://symfony.com/doc/current/cache.html#configuring-cache-with-frameworkbundle https://stackoverflow.com/a/46898727/6127393

Upvotes: 11

Related Questions