title: Symfony 301 redirect in the controller
body: <p>I have an entity <code>Event</code> with parameters <code>id</code> and <code>slug</code> in my Symfony app. 
  Parameter <code>slug</code> is nullable and not required so, if it missing, link to the single event page builds using <code>id</code>. But, if <code>slug</code> is set, url is build using this parameter.</p>
  
  <p>The task is to create 301 redirect for the events which are have slug. I'm, trying to use symfony method <code>redirect()</code> but I encountered a problem: when I set slug for the first time, it works fine and replaced me from the url <code>event/3</code> to <code>event/my-event-slug</code>. But when I removing slug or change it browser are still redirecting my to my first slug which was provided.   </p>
  
  <p>I'm checking it in Chrome console and it shows to me that my redirect 301 was loaded from cache.</p>
  
  <p>How can I prevent saving redirect to the cache or how can I solve this problem in another way in controller?</p>