diff --git a/cas.module b/cas.module
index 171edb2..15e896c 100644
--- a/cas.module
+++ b/cas.module
@@ -16,6 +16,29 @@ define('CAS_LOGIN_REDIR_MESSAGE', 'You will be redirected to the secure CAS logi
 define('CAS_EXCLUDE', 'services/*');
 
 /**
+ * Implementation of hook_boot().
+ * 
+ * Allow use of CAS gateway mode when caching is enabled
+ */
+function cas_boot() {
+  global $conf;
+  
+  // pre-requesites for subsequent drupal_get_path() calls
+  require_once './includes/path.inc';
+  drupal_language_initialize();
+  
+  $force_authentication = _cas_force_login();
+  $check_authentication = _cas_allow_check_for_login();
+  
+  if ($force_authentication || $check_authentication) {
+    // disable caching for this page request
+    $conf['cache'] = FALSE;
+    // then we resume the bootstrap phase
+    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+  }
+}
+
+/**
  * Implements hook_init().
  *
  * Traps a page load to see if authentication is required.
