From 89b0f3c947cb78269af67abe455d7a1fb586861f Mon Sep 17 00:00:00 2001
From: Colan Schwartz <colan@58704.no-reply.drupal.org>
Date: Mon, 18 Nov 2013 15:24:41 -0500
Subject: [PATCH] Issue #652610 by bloto, dawehner, johnv, colan: Time-based
 caching is writing cache when it is set to never cache.

---
 plugins/views_plugin_cache_time.inc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/plugins/views_plugin_cache_time.inc b/plugins/views_plugin_cache_time.inc
index 25245ea..03e028d 100644
--- a/plugins/views_plugin_cache_time.inc
+++ b/plugins/views_plugin_cache_time.inc
@@ -107,4 +107,21 @@ class views_plugin_cache_time extends views_plugin_cache {
       return CACHE_PERMANENT;
     }
   }
+
+  function cache_set($type) {
+    $lifespan = $this->get_lifespan($type);
+    if ($lifespan > 0) {
+      parent::cache_set($type);
+    }
+  }
+
+  function cache_get($type) {
+    $lifespan = $this->get_lifespan($type);
+    if ($lifespan > 0) {
+      return parent::cache_get($type);
+    }
+    else {
+      return FALSE;
+    }
+  }
 }
-- 
1.8.3.2

