What's the best way to clear cached JSON responses from a third-party API? I'm building a plugin to browse store orders via a third-party API. I make various requests to URLs that can include query parameters:


/customers
/orders/e8b48e72-9c7f-4d6f-91aa-2f7238bdf936
/orders?offset=0&amp;limit=250&amp;from=2014-05-26T22%3A58%3A38%2B00%3A00&amp;to=2014-06-26T22%3A58%3A38%2B00%3A00


I've just started using Guzzle and more importantly craft()-&gt;fileCache to keep results around for a few minutes and speed up browsing. I use the query URI as the key for the cache:

 craft()-&gt;fileCache-&gt;set($query, $response-&gt;getBody(true), 600); // store result for 10 minutes


A web hook gets hit with every new order that comes in, making it an ideal time to clear out these caches I've set—but I have no idea how.

Is there any way I can tag this plugin's caches or somehow clear out only those I've made, rather than get overzealous with craft()-&gt;fileCache-&gt;flushValues()?
You can delete a cache as follows:

craft()-&gt;fileCache-&gt;delete($key);


So instead of caching individual keys, you could perhaps cache an array of keys and delete the entire array when you want to clear out your keys.