title: When to clear the cache in Symfony 2 / 3 / 4
body: <h3>Question</h3>
  <p>When exactly do you need to run the following command in Symfony 2 / 3 / 4?</p>
  <pre><code>php app/console cache:clear --env=prod --no-debug
  </code></pre>
  <hr />
  <h3>Background</h3>
  <p>I thought it needed to be done when :</p>
  <ul>
  <li>adding / removing / modifying Twig files</li>
  <li>adding / removing / modifying YAML files</li>
  </ul>
  <p>However, I've just changed a version number in a YAML configuration file, in an old Symfony 2 app, and the new version number showed up in my browser without clearing the Symfony cache (I'm not using the &quot;app_dev.php&quot; front controller).</p>
  <p>Now, that YAML file (let's call it &quot;app/config/data.yml&quot;) was loaded like this, in a controller:</p>
  <pre><code>$data = Yaml::parse($this-&gt;get('kernel')-&gt;getRootDir() . '/config/data.yml');
  </code></pre>
  <p>and is not included in other YAML files.</p>
  <p>So, I guess in this case it isn't necessary to clear the cache?</p>
  <p>Also, are there other things that require clearing the cache? Like adding a new bundle?</p>