diff --git a/block/flickr_block.module b/block/flickr_block.module
index 4769567..6884e05 100644
--- a/block/flickr_block.module
+++ b/block/flickr_block.module
@@ -39,6 +39,9 @@ function flickr_block_info() {
 
   $blocks[10]['info'] = t("Random photos from a Flickr group");
   $blocks[11]['info'] = t("Random photos with a specific tag from a Flickr user");
+  for ($i = 0; $i < 12; $i++) {
+    $blocks[$i]['cache'] = DRUPAL_CACHE_GLOBAL;
+  }
   return $blocks;
 }
 
@@ -498,38 +501,44 @@ function _flickr_block_photosets($nsid, $show_n, $size) {
  * Random from user block.
  */
 function _flickr_block_random($nsid, $show_n, $size, $media) {
-  $output = '';
-  $random_photos = array();
-  if ($photos = flickr_photos_search($nsid, 1, array(
-    'per_page' => 500,
-    'media' => $media,
-  ))) {
-    $page_count = $photos['pages'];
-    // Do not try to return more than the total number of photos.
-    $to = min($show_n, $photos['total']);
+  if ($cache = cache_get('flickr_block_random')) {
+    $output = $cache->data;
+  }
+  else {
     $output = '';
-    for ($i = 0; $i < $to; $i++) {
-      sleep(0.125);
-      // Request a random page.
-      $photos = flickr_photos_search($nsid, rand(1, $page_count), array(
-        'per_page' => 500,
-        'media' => $media,
-      ));
-      // Select a random photo.
-      $index = rand(0, count($photos['photo']) - 1);
-      $photo_id = $photos['photo'][$index]['id'];
-      if (in_array($photo_id, $random_photos)) {
-        // Photo already added.
-        $i--;
-      }
-      else {
-        $random_photos[] = $photo_id;
-        $output .= theme('flickr_block_photo', array(
-          'photo' => $photos['photo'][$index],
-          'size' => $size,
+    $random_photos = array();
+    if ($photos = flickr_photos_search($nsid, 1, array(
+      'per_page' => 500,
+      'media' => $media,
+    ))) {
+      $page_count = $photos['pages'];
+      // Do not try to return more than the total number of photos.
+      $to = min($show_n, $photos['total']);
+      $output = '';
+      for ($i = 0; $i < $to; $i++) {
+        sleep(0.125);
+        // Request a random page.
+        $photos = flickr_photos_search($nsid, rand(1, $page_count), array(
+          'per_page' => 500,
+          'media' => $media,
         ));
+        // Select a random photo.
+        $index = rand(0, count($photos['photo']) - 1);
+        $photo_id = $photos['photo'][$index]['id'];
+        if (in_array($photo_id, $random_photos)) {
+          // Photo already added.
+          $i--;
+        }
+        else {
+          $random_photos[] = $photo_id;
+          $output .= theme('flickr_block_photo', array(
+            'photo' => $photos['photo'][$index],
+            'size' => $size,
+          ));
+        }
       }
     }
+    cache_set('flickr_block_random', $output, 'cache', time() + (24 * 60 * 60));
   }
   return $output;
 }
@@ -538,40 +547,46 @@ function _flickr_block_random($nsid, $show_n, $size, $media) {
  * Random from photoset block.
  */
 function _flickr_block_photoset_random($nsid, $show_n, $size, $media, $photoset_id) {
-  // Get information about the photoset, including the owner.
-  $info = flickr_photoset_get_info($photoset_id);
-  if (!$info) {
-    return;
+  if ($cache = cache_get('flickr_block_photoset_random')) {
+    $output = $cache->data;
   }
+  else {
+    // Get information about the photoset, including the owner.
+    $info = flickr_photoset_get_info($photoset_id);
+    if (!$info) {
+      return;
+    }
 
-  // Get a list of "all" the photos in the photoset. This is cached.
-  $response = flickr_request('flickr.photosets.getPhotos',
-    array(
-      'photoset_id' => $photoset_id,
-      // Get as many images as possible.
-      'per_page' => 500,
-      'extras' => 'owner',
-      'media' => $media,
-    )
-  );
-  if (!$response) {
-    return;
-  }
+    // Get a list of "all" the photos in the photoset. This is cached.
+    $response = flickr_request('flickr.photosets.getPhotos',
+      array(
+        'photoset_id' => $photoset_id,
+        // Get as many images as possible.
+        'per_page' => 500,
+        'extras' => 'owner',
+        'media' => $media,
+      )
+    );
+    if (!$response) {
+      return;
+    }
 
-  // Randomly display $show_n of them.
-  $photos = $response['photoset']['photo'];
-  shuffle($photos);
+    // Randomly display $show_n of them.
+    $photos = $response['photoset']['photo'];
+    shuffle($photos);
 
-  // We shouldn't try to return more than the total number of photos.
-  $output = '';
-  $to = min($show_n, count($photos));
-  for ($i = 0; $i < $to; $i++) {
-    // Insert owner into $photo because theme_flickr_photo needs it.
-    $photos[$i]['owner'] = $info['owner'];
-    $output .= theme('flickr_block_photo', array(
-      'photo' => $photos[$i],
-      'size' => $size,
-    ));
+    // We shouldn't try to return more than the total number of photos.
+    $output = '';
+    $to = min($show_n, count($photos));
+    for ($i = 0; $i < $to; $i++) {
+      // Insert owner into $photo because theme_flickr_photo needs it.
+      $photos[$i]['owner'] = $info['owner'];
+      $output .= theme('flickr_block_photo', array(
+        'photo' => $photos[$i],
+        'size' => $size,
+      ));
+    }
+    cache_set('flickr_block_photoset_random', $output, 'cache', time() + (24 * 60 * 60));
   }
   return $output;
 }
@@ -580,32 +595,38 @@ function _flickr_block_photoset_random($nsid, $show_n, $size, $media, $photoset_
  * Random from group block.
  */
 function _flickr_block_group_random($group_id, $show_n, $size, $media) {
-  // Get a list of "all" the photos in the group. This is cached.
-  $response = flickr_request('flickr.groups.pools.getPhotos',
-    array(
-      'group_id' => $group_id,
-      // Get as many images as possible.
-      'per_page' => 500,
-      'extras' => 'owner',
-      'media' => $media,
-    )
-  );
-  if (!$response) {
-    return;
+  if ($cache = cache_get('flickr_block_group_random')) {
+    $output = $cache->data;
   }
+  else {
+    // Get a list of "all" the photos in the group. This is cached.
+    $response = flickr_request('flickr.groups.pools.getPhotos',
+      array(
+        'group_id' => $group_id,
+        // Get as many images as possible.
+        'per_page' => 500,
+        'extras' => 'owner',
+        'media' => $media,
+      )
+    );
+    if (!$response) {
+      return;
+    }
 
-  // Randomly display $show_n of them.
-  $photos = $response['photos']['photo'];
-  shuffle($photos);
+    // Randomly display $show_n of them.
+    $photos = $response['photos']['photo'];
+    shuffle($photos);
 
-  // We shouldn't try to return more than the total number of photos.
-  $output = '';
-  $to = min($show_n, count($photos));
-  for ($i = 0; $i < $to; $i++) {
-    $output .= theme('flickr_block_photo', array(
-      'photo' => $photos[$i],
-      'size' => $size,
-    ));
+    // We shouldn't try to return more than the total number of photos.
+    $output = '';
+    $to = min($show_n, count($photos));
+    for ($i = 0; $i < $to; $i++) {
+      $output .= theme('flickr_block_photo', array(
+        'photo' => $photos[$i],
+        'size' => $size,
+      ));
+    }
+    cache_set('flickr_block_group_random', $output, 'cache', time() + (24 * 60 * 60));
   }
   return $output;
 }
@@ -615,29 +636,35 @@ function _flickr_block_group_random($group_id, $show_n, $size, $media) {
  * Random by tag block.
  */
 function _flickr_block_tag_random($nsid, $show_n, $size, $media, $tag) {
-  // Do a photo search for the provided tag in the given user's public photos.
-  $response = flickr_request('flickr.photos.search',
-    array(
-      'user_id' => $nsid,
-      'tags' => $tag,
-      'per_page' => 500,
-      'privacy_filter' => 1,
-      'media' => $media,
-    )
-  );
+ if ($cache = cache_get('flickr_block_tag_random')) {
+    $output = $cache->data;
+  }
+  else {
+    // Do a photo search for the provided tag in the given user's public photos.
+    $response = flickr_request('flickr.photos.search',
+      array(
+        'user_id' => $nsid,
+        'tags' => $tag,
+        'per_page' => 500,
+        'privacy_filter' => 1,
+        'media' => $media,
+      )
+    );
 
-  // Randomly display $show_n of them.
-  $photos = $response['photos']['photo'];
-  shuffle($photos);
+    // Randomly display $show_n of them.
+    $photos = $response['photos']['photo'];
+    shuffle($photos);
 
-  // We shouldn't try to return more than the total number of photos.
-  $output = '';
-  $to = min($show_n, count($photos));
-  for ($i = 0; $i < $to; $i++) {
-    $output .= theme('flickr_block_photo', array(
-      'photo' => $photos[$i],
-      'size' => $size,
-    ));
+    // We shouldn't try to return more than the total number of photos.
+    $output = '';
+    $to = min($show_n, count($photos));
+    for ($i = 0; $i < $to; $i++) {
+      $output .= theme('flickr_block_photo', array(
+        'photo' => $photos[$i],
+        'size' => $size,
+      ));
+    }
+    cache_set('flickr_block_tag_random', $output, 'cache', time() + (24 * 60 * 60));
   }
   return $output;
 }
