title: Key groups with APC cache
body: <p>APC lets you store data inside keys, but you cannot group these keys.</p>
  
  <p>So if i want to have a group called "articles", and inside this group I would have keys that take the form of the article ID I can't do this easily.</p>
  
  <pre><code>articles -&gt; 5   -&gt; cached data
           -&gt; 10  -&gt; cached data
           -&gt; 17  -&gt; cached data
  
           ...
  </code></pre>
  
  <p>I could prefix the key with the "group" name like:</p>
  
  <pre><code>article_5   -&gt; cached data
  article_10  -&gt; cached data
  article_17  -&gt; cached data
  
   ...
  </code></pre>
  
  <p>But this it makes it impossible to delete the entire group if I want to :(</p>
  
  <p>A working solution would be to store multidimensional arrays (this is what I'm doing now), but I don't think it's good because when I want to access / or delete cached data, I need to get the entire group first. So if the group has one zillion articles in it you can image what kind of array I will be iterating and searching</p>
  
  <p>Do you have better ideas on how could I achieve the group thing?</p>
  
  <p><hr>
  <strong>edit:</strong> found another solution, not sure if it's much better because I don't know how reliable is yet. I'm adding a special key called <code>__paths</code> which is basically a multidimensional array containing the full prefixed key paths for all the other entries in the cache. And when I request or delete the cache I use this array as a reference to quickly find out the key (or group of keys) I need to remove, so I don't have to store arrays and iterate trough all keys...</p>