diff --git a/twitter_pull.module b/twitter_pull.module
index f959fb5..2846963 100644
--- a/twitter_pull.module
+++ b/twitter_pull.module
@@ -5,8 +5,9 @@
  * Twitter Pull module.
  */
 
-define ('TWITTER_PULL_NUM_ITEMS', 5);
-define ('TWITTER_PULL_CACHE_LENGTH', 20); //-- cache for 20 minutes
+define ('TWITTER_PULL_NUM_ITEMS', 6);
+define ('TWITTER_PULL_CACHE_LENGTH', 0); //-- Refresh every 20 mins, or 0 for CACHE_PERMANENT
+define ('TWITTER_PULL_REFRESH_DELAY', 1); //-- Refresh every 20 mins
 define ('TWITTER_PULL_EMPTY_MESSAGE', 'No Tweets');
 define ('TWITTER_PULL_CACHE_TABLE', 'cache_pulled_tweets');
 
@@ -22,6 +23,10 @@ function twitter_pull_empty_message() {
   return variable_get('twitter_pull_empty_message', TWITTER_PULL_EMPTY_MESSAGE);
 }
 
+function twitter_pull_refresh_delay() {
+  return variable_get('twitter_pull_refresh_delay', TWITTER_PULL_REFRESH_DELAY);
+}
+
 /**
  * Implements hook_menu().
  */
@@ -41,7 +46,7 @@ function twitter_pull_menu() {
  * Implements hook_flush_caches().
  */
 function twitter_pull_flush_caches() {
-  return array(TWITTER_PULL_CACHE_TABLE);
+  cache_clear_all(NULL, TWITTER_PULL_CACHE_TABLE);
 }
 
 /**
@@ -154,15 +159,27 @@ function twitter_pull_retrieve($twitkey, $num_items = NULL) {
 
   $tweets = array();
 
-  if (!empty($cache) && !empty($cache->data) && (time() < $cache->expire)) {
-    $tweets =  $cache->data;
-  }
-  else {
-    try {
-      $puller = new twitter_puller($twitkey, $num_items);
-      $puller->get_items();
-      $tweets = $puller->tweets;
-    }
+  $refresh_delay = twitter_pull_refresh_delay();
+  $refresh = $refresh_delay && ($cache->created < (time() - ($refresh_delay * 60)));
+  if (empty($cache) || empty($cache->data) || $refresh) {
+     try {
+       $puller = new twitter_puller($twitkey, $num_items);
+       $puller->get_items();
+       $tweets = $puller->tweets;
+      // Pad out tweets with items from the cache
+      if (($count = ($num_items - count($tweets))) && $cache->data) {
+        $i = 0;
+        $tweet_ids = array_map('twitter_pull_map_ids', $tweets);
+        while ($count > 0 && $i < count($cache->data)) {
+          if (!in_array($cache->data[$i]->id, $tweet_ids)) {
+            $tweets[] = $cache->data[$i];
+            $count--;
+          }
+          $i++;
+        }
+      }
+     }
+
     catch (Exception $e) {
       watchdog('Twitter Pull', $e->getMessage(), array(), WATCHDOG_WARNING);
       if (!empty($cache) && !empty($cache->data)) {
@@ -174,11 +191,21 @@ function twitter_pull_retrieve($twitkey, $num_items = NULL) {
     }
 
     if (!empty($tweets) && is_array($tweets)) {
-      $cache_length = twitter_pull_cache_length() * 60; //-- in the settings we indicate length in minutes, here we need seconds.
-      cache_set($cache_key, $tweets, TWITTER_PULL_CACHE_TABLE, REQUEST_TIME + $cache_length);
+      if ($cache_length = twitter_pull_cache_length()) {
+        $cache_length *= 60;
+        $cache_length += time();
+      }
+      else{
+        $cache_length = CACHE_PERMANENT;
+      }
+      cache_set($cache_key, $tweets, TWITTER_PULL_CACHE_TABLE, $cache_length);
     }
   }
 
+  else {
+    $tweets = $cache->data;
+  }
+
   // If we have tweets and are viewing a secure site, we want to set the url
   // to the userphoto to use the secure image to avoid insecure errors.
   if (!empty($tweets) && is_array($tweets) && $is_https) {
@@ -190,6 +217,10 @@ function twitter_pull_retrieve($twitkey, $num_items = NULL) {
   return $tweets;
 }
 
+function twitter_pull_map_ids($cached_data) {
+  return $cached_data->id;
+}
+
 /**
  * Automatically add links to URLs and Twitter usernames in a tweet.
  */
