Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable cache in symfony

Tags:

php

symfony

I am developing a website in symfony framework. In my cache folder a huge cache is stored. I want to disable cache permanently.

like image 449
Karan Kumar Avatar asked Sep 04 '15 11:09

Karan Kumar


People also ask

How do I clear the cache in Symfony?

The global clearer clears all the cache items in every pool. The system cache clearer is used in the bin/console cache:clear command. The app clearer is the default clearer. The cache:pool:invalidate-tags command was introduced in Symfony 6.1. To encrypt the cache using libsodium, you can use the SodiumMarshaller.

What is Symfony caching?

The Symfony cache system is different because it relies on the simplicity and power of the HTTP cache as defined in RFC 7234 - Caching. Instead of reinventing a caching methodology, Symfony embraces the standard that defines basic communication on the Web.

How to disable the default Symfony behavior that makes requests uncacheable?

In order to disable the default Symfony behavior that makes requests using the session uncacheable, add the following internal header to your response and Symfony won't modify it: Symfony was designed to follow the proven rules of the road: HTTP. Caching is no exception.

How do I use a chain of adapters in Symfony?

To get the best of both worlds you may use a chain of adapters. A cache chain combines several cache pools into a single one. When storing an item in a cache chain, Symfony stores it in all pools sequentially. When retrieving an item, Symfony tries to get it from the first pool.


1 Answers

While I advise against disabling the cache on a production system, you can disable the twig templating engine cache, by editing and adding to your config.yml file

twig:
    cache: false
like image 58
Diego Ferri Avatar answered Sep 28 '22 00:09

Diego Ferri