diff --git a/dynamic_cache.module b/dynamic_cache.module
index b4dfa85..b41314f 100755
--- a/dynamic_cache.module
+++ b/dynamic_cache.module
@@ -8,7 +8,7 @@
  * Implementation of hook_boot().
  */
 function dynamic_cache_boot() {
-  if ($GLOBALS['conf']['cache'] == CACHE_DISABLED) {
+  if (dynamic_cache_should_run()) {
   
     // First, complete remaining DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE steps from from _drupal_bootstrap() in includes/bootstrap.inc.
     
@@ -49,3 +49,24 @@ function dynamic_cache_boot() {
     exit;
   }
 }
+
+/**
+ * Helper function that tests whether or not bootstrap should be hijacked.
+ */
+function dynamic_cache_should_run() {
+  // Bootstrap called outside of normal index.php (e.g. cron.php).
+  if (strpos($_SERVER['PHP_SELF'], 'index.php') === FALSE) {
+    return FALSE;
+  }
+  // We are in a drush context.
+  if (defined('DRUSH_BOOTSTRAP_DRUPAL_FULL')) {
+    return FALSE;
+  }
+
+  // Hijack the bootstrap.
+  if ($GLOBALS['conf']['cache'] == CACHE_DISABLED) {
+    return TRUE;
+  }
+
+  return FALSE;
+}
