? cacheexclude-478790.patch
Index: cacheexclude.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cacheexclude/cacheexclude.module,v
retrieving revision 1.6.2.3
diff -u -p -r1.6.2.3 cacheexclude.module
--- cacheexclude.module	27 May 2009 18:31:30 -0000	1.6.2.3
+++ cacheexclude.module	8 Jun 2009 19:22:35 -0000
@@ -22,13 +22,19 @@ function cacheexclude_menu() {
  * Administrative settings form.
  */
 function cacheexclude_admin_settings() {
+
+  // Options to exclude by node type
+  $full_types = node_get_types();
+  foreach ($full_types as $type) {
+    $types[$type->type] = $type->name;
+  }
+
   $form['cacheexclude_list'] = array(
-    '#type' => 'textarea',
+    '#type' => 'checkboxes',
     '#title' => t('Pages to exclude from caching'),
-    '#default_value' => variable_get('cacheexclude_list', ''),
-    '#width' => 40,
-    '#height' => 10,
-    '#description' => t("Enter one page per line as Drupal paths. Don't begin link with trailing slash. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')),
+    '#default_value' => variable_get('cacheexclude_list'. $node->type, array('', '')),
+    '#options' => $types,
+    '#description' => t("Check all that apply."),
   );
 
   // Add an additional submit handler to clear the cache after list is updated.
@@ -66,4 +72,12 @@ function cacheexclude_init() {
                          drupal_match_path(drupal_get_path_alias($_GET['q']), $pages) )) {
     $GLOBALS['conf']['cache'] = 0;
   }
+  // Check if the current node type is one we want to exclude from the cache
+  $types = variable_get('cacheexclude_node', array());
+  if (count($types) && arg(0) == 'node') {
+    $node = node_load(arg(1));
+    if (in_array($node->type, $types)) {
+      $GLOBALS['conf']['cache'] = FALSE;
+    }
+  }
 }
