Index: ajaxcache.module
===================================================================
--- ajaxcache.module	(revision 27118)
+++ ajaxcache.module	(working copy)
@@ -175,17 +175,39 @@
 }
 
 /**
- * Flush the cache file(s) for a specific preset.
+ * Helper function to flush the cache file(s) for a specific preset.
  */
 function ajaxcache_flush_preset($preset) {
+  ajaxcache_flush_by_args($preset);
+}
+
+/**
+ * Flush the cache file(s) for a specific preset + set of arguments
+ * @param $preset
+ *   String or preset array
+ * @param $args
+ *   Array of arguments
+ * @return
+ *   False if the preset couldn't be found. True otherwise (even if the args
+ *   couldn't be found)
+ */
+function ajaxcache_flush_by_args($preset, $args = array()) {
   if (is_string($preset)) {
     $preset = ajaxcache_get_preset($preset);
   }
+  // Make sure we don't flush everything on a bad call
+  if (!isset($preset['name'])) {
+    return FALSE;
+  }
 
-  $presetdir = realpath(file_directory_path() .'/ajaxcache/'. $preset['name']);
-  if (is_dir($presetdir)) {
-    _ajaxcache_recursive_delete($presetdir);
-  } 
+  $dir = realpath(file_directory_path() .'/ajaxcache/'. $preset['name']);
+  if (!empty($args)) {
+    $dir .= '/' . implode('/', $args);
+  }
+  if (is_dir($dir)) {
+    _ajaxcache_recursive_delete($dir);
+  }
+  return TRUE;
 }
 
 /**
