title: Full view caching for dynamic routes in cakephp
body: <p>I am having some issues with full <a href="http://book.cakephp.org/view/325/View-Caching" rel="nofollow noreferrer">view caching</a> in cakephp.</p>
  
  <p>The url that I would like to cache is <code>/posts/badge/23/size:180x150</code> I have been able to cache the view successfully by adding <code>$cacheAction = "1 hour";</code> to the controller.</p>
  
  <p>Since I do not want to cache all methods in the controller (just specific methods) I tried to use the array syntax to match the url <code>/posts/badge/23/size:180x150</code>
  where 23 is the post ID and size is a named parameter (there are 2
  variations of size).</p>
  
  <p>So my question is what is the proper (if any) match to place in
  cacheAction to cache all posts/badges/* Here are some examples that I
  have tried:</p>
  
  <pre><code>var $cacheAction = array(
          'badge/*' =&gt; '+1 hour',
          'posts/badge/23/size:180x150' =&gt; '1 hour',
          'badge/23/size:180x150' =&gt; '1 hour',
          'posts/badge/:id/:size' =&gt; '1 hour',
          'badge/:id/:size' =&gt; '1 hour',
  );
  </code></pre>
  
  <p>None of these seem to match (or at least do not cache for some
  reason). I do need to cache posts/badge/<em>/size:</em> and trap each of the
  parameters being passed.</p>
  
  <p>Again, if I set $cacheAction = "1 hour"; then the cache file is
  created (the file tmp/cache/views/posts_badge_23_size_180x150.php is
  created) </p>
  
  <p>Has anyone been able to create a cache for a dynamic url?</p>