diff --git a/cas.module b/cas.module
index 27ee065..17821d7 100644
--- a/cas.module
+++ b/cas.module
@@ -15,6 +15,24 @@ define('CAS_LOGIN_DRUPAL_INVITE_DEFAULT', 'Cancel CAS login');
 define('CAS_LOGIN_REDIR_MESSAGE', 'You will be redirected to the secure CAS login page.');
 define('CAS_EXCLUDE', 'services/*');
 
+
+/**
+ * Implementation of hook_boot().
+ * Allow to use CAS gateway mode with cache enabled
+ * @see http://drupal.org/node/1084302
+ */
+function cas_boot() {
+  global $conf;
+  require_once './includes/path.inc';
+  if(_cas_allow_check_for_login()){
+    // we override the cache setting just for CAS gateway request
+    unset($conf['cache']);
+    $conf['cache']= CACHE_DISABLED;
+    // then we resume the bootstrap phase
+    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+  }
+}
+
 /**
  * Implementation of hook_init().
  *
